[英]Launch FancyBox on page load
I am using fancyapps.com 's FancyBox and I was wondering how to call a fancybox.ajax when the page loads.我正在使用fancyapps.com的 FancyBox,我想知道如何在页面加载时调用 fancybox.ajax。
Here is what I have:这是我所拥有的:
$(document).ready(function(){
$("#what").fancybox();
});
<a href="what.html" id="what" class="fancybox fancybox.ajax"></a>
call the method on document ready在文档准备好时调用方法
HTML HTML
<a id="myFancybox" href="http://mydomain.com/mine.jpg" />
and script is脚本是
$(function(){
$("#myFancybox").fancybox();
});
http://api.jquery.com/ready/ http://api.jquery.com/ready/
document.ready
specify a function to execute when the DOM is fully loaded. document.ready
指定一个 function 在 DOM 完全加载时执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.