gpt4 book ai didi

html - 在页面加载时调用 Twitter Bootstrap Lightbox

转载 作者:行者123 更新时间:2023-11-28 12:14:18 24 4
gpt4 key购买 nike

我需要我的 Twitter Bootstrap 灯箱在 HTML 页面加载后立即触发,目前我的“main.js”文件中有这个:

function lightbox(){
$('#myLightbox').lightbox();
};

显然我可以使用 window.pulse 命令?我对 jquery 的了解还很基础。

这是灯箱的 html 标记:

<div id="myLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class='lightbox-content'>
<img src="path/to/picture.jpg">
<div class="lightbox-caption"><p>The lightbox is here.</p></div>
</div>
</div>

最佳答案

试试这个:

$(document).ready(function () {
$('#myLightbox').show();
});

这样,当您的页面加载时,您的灯箱就会显示。

确保您在 HTML 页面中引用了 jQuery。

希望这对您有所帮助。

关于html - 在页面加载时调用 Twitter Bootstrap Lightbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19292885/

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