链接需要双击才能起作用:为什么?

发布于 2024-12-17 18:36:36 字数 297 浏览 3 评论 0原文

请转到此处并单击链接两次:http://bogsorken.com/test/index.html

它将打开一个 fancybox 窗口,其中嵌入了 Vimeo 视频。现在,我花了一整天的时间试图找出为什么该链接需要双击。有比我更有经验的人可以解决这个难题吗?请注意,如果您单击了一次,则只需要单击一次,直到刷新页面。

显然,我希望只需单击一下即可使链接发挥作用。

Please go here and click on the link twice: http://bogsorken.com/test/index.html

It will open up a fancybox window with a Vimeo video embedment inside. Now, I have spent all day trying to figure out why the link requires a double click. Is there someone more experienced than me that can solve this puzzle? Note that when you have clicked on it once, then it will only require one click, until you refresh the page.

Obviously, I want the link to function with only one click.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必你懂 2024-12-24 18:36:36

编辑:在评论中与op交谈后更改。

看来我们使用它完全不正确。只需在 doc.ready 实例化 fancybox 并像往常一样等待点击即可。没有点击处理程序,那是 fancyboxes 的工作。

jsFiddle

$("#vimeo_autoplay").fancybox({
    'href' : 'http://vimeo.com/moogaloop.swf?clip_id=18669276&autoplay=1',
    'opacity'       : true,
    'overlayColor'  : '#000',
    'overlayOpacity' : 0.8,
    'centerOnScroll' : false,
    'titlePosition' : 'over',
    'width' : 720,
    'height' : 405,
    'type' : 'swf',
    'swf' : {
    'wmode' : 'transparent',
    'allowfullscreen' : 'true'
    }

});

edit: changed after conversation with op in comments.

Well it appears we were using it entirely improperly. Just instantiate the fancybox at doc.ready and wait for the click as usual. No click handlers, that's fancyboxes job.

jsFiddle

$("#vimeo_autoplay").fancybox({
    'href' : 'http://vimeo.com/moogaloop.swf?clip_id=18669276&autoplay=1',
    'opacity'       : true,
    'overlayColor'  : '#000',
    'overlayOpacity' : 0.8,
    'centerOnScroll' : false,
    'titlePosition' : 'over',
    'width' : 720,
    'height' : 405,
    'type' : 'swf',
    'swf' : {
    'wmode' : 'transparent',
    'allowfullscreen' : 'true'
    }

});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文