【问题标题】:jQuery isotope - Page jumps to top when clicking on embedded youtube video in FirefoxjQuery isotope - 在 Firefox 中单击嵌入的 youtube 视频时页面跳转到顶部
【发布时间】:2012-11-13 17:04:17
【问题描述】:

我有一个使用 jQuery 同位素和砖石布局的页面。有许多 div,一个是嵌入为 html5 的 youtube 视频。

由于某种原因,在 Firefox 中单击 youtube 视频时,页面会跳回页面顶部。它在 Safari/Chrome 中完美运行。

如果有人对可能导致此问题的原因有任何想法,将不胜感激!

JSBIN:http://jsbin.com/iwehev/2

【问题讨论】:

    标签: javascript jquery css firefox jquery-isotope


    【解决方案1】:

    你的例子没有做你为我描述的事情。听起来您正在寻找preventDefault();。在单击功能中使用它,以了解任何元素在单击时给您带来的问题。

    $('a').click(function(evt){
        evt.preventDefault();
    });
    

    【讨论】:

      【解决方案2】:
      $('#wall').isotope({
          itemSelector: '.box',
          animationEngine: 'css,
          layoutMode: 'masonry',
          transformsEnabled: false //Disable transformations
      });
      

      将 transformsEnabled: false 添加到同位素函数。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-04-10
        • 1970-01-01
        • 2014-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多