Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery中的弹出函数_Jquery_Popup_Append - Fatal编程技术网

jquery中的弹出函数

jquery中的弹出函数,jquery,popup,append,Jquery,Popup,Append,案例:我在html部分中添加了不同的配置文件,其中包含图片、姓名、年龄和性别。(想想Tinder,但一次显示10个ish配置文件。)我想要一个函数,它可以生成一个弹出窗口,在p标签中打印出“NewInterest”,特定于每个配置文件。如果你点击了一个按钮或者点击了个人资料图片,那就没那么重要了 我找不到任何方法来做这件事,也许你们有解决办法提前谢谢 注意:附加配置文件是一项工作。我能够用名字等来显示图片,我只是找不到一种方法来实现每个配置文件的特定弹出窗口 注2:让newInterests=p

案例:我在html部分中添加了不同的配置文件,其中包含图片、姓名、年龄和性别。(想想Tinder,但一次显示10个ish配置文件。)我想要一个函数,它可以生成一个弹出窗口,在p标签中打印出“NewInterest”,特定于每个配置文件。如果你点击了一个按钮或者点击了个人资料图片,那就没那么重要了

我找不到任何方法来做这件事,也许你们有解决办法提前谢谢

注意:附加配置文件是一项工作。我能够用名字等来显示图片,我只是找不到一种方法来实现每个配置文件的特定弹出窗口

注2:让newInterests=profileInterests=profile.description;打印出变量。我只想它被包括在一个弹出窗口

HTML:

<section id="profileSection">


</section>

JS:

$(“#showAllMenBtn”)。单击(函数(){
$(“#profileSection”).html(“”);
$(配置文件)。每个(功能)(索引、配置文件){
让profileImg=$(“
我从JSON模块获取所有信息,您可以在这里看到:


你可以编写一个完整的模态库,或者如果你使用的是Bootstrap或Fund之类的东西,它们为你提供了所有这些功能,不幸的是,我不能使用其中任何一个,我正试图找到一种用普通jQuery来实现这一点的方法。你会想要一个固定的/绝对定位的DIV,显示一个模态(弹出窗口)。这是用户单击配置文件时生成的。您还需要一些东西来维护打开的模态列表,并为您处理关闭模态之类的事情。
$("#showAllMenBtn").click(function(){   

          $("#profileSection").html("");

          $(maleProfiles).each(function(index, profile){

               let profileImg = $("<img>", {src:`${profile.imageSrc}`});            
               let newName = profileName = profile.name;
               let newAge = profileAge = profile.age;
               let newGender = profileGender = profile.gender;
               //let newInterests = profileInterests = profile.description;     


               $("#profileSection").append(profileImg, newName, newAge, newGender);
          })

 });