Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.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
Javascript Fancybox唯一url内联内容链接_Javascript_Jquery_Url_Fancybox - Fatal编程技术网

Javascript Fancybox唯一url内联内容链接

Javascript Fancybox唯一url内联内容链接,javascript,jquery,url,fancybox,Javascript,Jquery,Url,Fancybox,我希望使用url加载fancybox弹出窗口,因此上传加载fancybox弹出窗口使用: www.mysite.com/index.html#hrefgoesher 剧本是什么 谢谢你的帮助和指导 凯尔 更新 谢谢大家的帮助!!这就是最终对我有用的东西。我将我的内容保存到单独的html文件中,然后用fancybox.iframe调用它们 JS: $(文档).ready(函数(){ $('.fancybox')。fancybox({ “滚动”:“否” }); if(window.location

我希望使用url加载fancybox弹出窗口,因此上传加载fancybox弹出窗口使用:

www.mysite.com/index.html#hrefgoesher

剧本是什么

谢谢你的帮助和指导

凯尔

更新

谢谢大家的帮助!!这就是最终对我有用的东西。我将我的内容保存到单独的html文件中,然后用fancybox.iframe调用它们

JS:


$(文档).ready(函数(){
$('.fancybox')。fancybox({
“滚动”:“否”
});
if(window.location.hash!==“”){
$(window.location.hash);
}
});

您可以尝试使用fancybox方法,我认为这样更安全:

例:

<script>
$(document).ready(function () {
    $('.fancybox').fancybox({
     'scrolling'   : 'no'   
    });
    if (window.location.hash !== "") {
        $(window.location.hash).click();
    }
});
</script>
$(document).ready(function($) { 
    $.fancybox({
        content: $(window.location.hash).html()
    });
});