gpt4 book ai didi

javascript - 使用类时 jQuery Popup Overlay 不显示

转载 作者:行者123 更新时间:2023-12-03 08:32:18 26 4
gpt4 key购买 nike

知道为什么这在将其作为类调用时不起作用吗?我正在尝试为数据库中的每个条目制作文件内容的弹出窗口。与此略有无关,但我想添加一下以澄清意图。

<div id="myModal">Filename</div>

<!-- Add an optional button to open the popup -->
<button class="my_popup_open">Open popup</button>

<!-- Add content to the popup -->
<div id="my_popup">

<p class="my_popup">"$GPGGA,172247.103,,,,,0,0,,,M,,M,,*4F
$GPGGA,172257.000,3027.4646,N,09008.6986,W,1,13,0.81,21.2,M,-26.0,M,,*6F
$GPGGA,172307.000,3027.4661,N,09008.6977,W,1,14,0.71,23.3,M,-26.0,M,,*6B
$GPGGA,172317.000,3027.4681,N,09008.6962,W,1,14,0.71,23.9,M,-26.0,M,,*6A
$GPGGA,172327.000,3027.4683,N,09008.6927,W,1,14,0.72,23.5,M,-26.0,M,,*65
$GPGGA,172337.000,3027.4684,N,09008.6880,W,1,14,0.71,23.3,M,-26.0,M,,*6A
$GPGGA,172347.000,3027.4679,N,09008.6880,W,1,17,0.62,23.4,M,-26.0,M,,*69
$GPGGA,172357.000,3027.4679,N,09008.6880,W,1,17,0.62,23.4,M,-26.0,M,,*68
$GPGGA,172407.000,3027.4679,N,09008.6881,W,1,18,0.60,23.3,M,-26.0,M,,*61
$GPGGA,172417.000,3027.4678,N,09008.6881,W,1,19,0.58,23.3,M,-26.0,M,,*6B
$GPGGA,172427.000,3027.4675,N,09008.6899,W,1,19,0.57,23.2,M,-26.0,M,,*62
$GPGGA,172437.000,3027.4688,N,09008.6963,W,1,19,0.57,21.7,M,-26.0,M,,*62
$GPGGA,172447.000,3027.4690,N,09008.6973,W,1,18,0.59,20.3,M,-26.0,M,,*67
$GPGGA,172507.000,3027.4695,N,09008.6981,W,2,18,0.59,17.3,M,-26.0,M,0000,0000*6D
$GPGGA,172517.000,3027.4697,N,09008.6981,W,2,18,0.59,15.5,M,-26.0,M,0000,0000*6A
$GPGGA,172527.000,3027.4700,N,09008.6980,W,2,18,0.59,14.1,M,-26.0,M,0000,0000*62
"</p>


</div>








<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-1.8.2.min.js"></script>

<!-- Include jQuery Popup Overlay -->
<script src="https://cdn.rawgit.com/vast-engineering/jquery-popup-overlay/1.7.10/jquery.popupoverlay.js"></script>



<script>
$(document).ready(function() {

// Initialize the plugin
$('.my_popup').popup();

});
</script>

如果我改变:

$('.my_popup').popup();

致:

   <p id="my_popup">

and


$('#my_popup').popup();

效果很好。但这不允许我在单个页面上复制设置。

最佳答案

您使用的库显式引用节点的 id 来标识打开/关闭按钮元素。来自其source code :

var openelement = (options.openelement) ? options.openelement : ('.' + el.id + opensuffix);

您可以通过提供自己的openelement来解决这个问题,如下所示:

$('.my_popup').popup({ openelement: ".my_popup_open" });

关于javascript - 使用类时 jQuery Popup Overlay 不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33293493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com