加载iframe视频javascript时避免页面刷新

时间:2012-12-31 12:21:26

标签: javascript html5

我的网页上有一个滚动的iframe视频部分。问题是页面在滚动中的每个iframe加载上刷新。我使用过这个网站http://www.smoothdivscroll.com/index.html#toc的滚动条。如何在加载iframe时避免页面刷新?

HTML:

<div id="logoParade">
  <div class="scrollWrapper">
    <div class="scrollableArea">
      <div class="product-box" id="test">
        <iframe width="700" height="500" src="http://www.youtube.com/embed/QTKM-54zWm4" frameborder="0" allowfullscreen></iframe>
      </div>
      <div class="product-box" id="test">
        <iframe width="700" height="500" src="http://www.youtube.com/embed/QTKM-54zWm4" frameborder="0" allowfullscreen></iframe>
      </div>
      <div class="product-box" id="test">
        <iframe width="700" height="500" src="http://www.youtube.com/embed/QTKM-54zWm4" frameborder="0" allowfullscreen></iframe>
      </div>
      <div class="product-box" id="test">
        <iframe width="700" height="500" src="http://www.youtube.com/embed/QTKM-54zWm4" frameborder="0" allowfullscreen></iframe>
      </div>
      <div class="product-box" id="test">
        <iframe width="700" height="500" src="http://www.youtube.com/embed/QTKM-54zWm4" frameborder="0" allowfullscreen></iframe>
      </div>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

每个iframe加载都没有刷新,至少不是我所知道的。 我在HTML中看到的唯一问题是类似的ID属性(“test”),它与刷新无关,只是你应该修复的东西。

我已经使用插件测试了你的代码,它运行正常。

相关问题