Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/438.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
加载iframe视频javascript时避免页面刷新_Javascript_Html - Fatal编程技术网

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

加载iframe视频javascript时避免页面刷新,javascript,html,Javascript,Html,我的网页上有一个滚动iframe视频部分。问题是在scroll中每次加载iframe时页面都会刷新。我使用了这个网站的滚动条http://www.smoothdivscroll.com/index.html#toc。如何在加载iframe时避免页面刷新 Html: 每个iframe加载都没有刷新,至少据我所知没有。 我在HTML中看到的唯一问题是类似的ID属性(“test”),它与刷新无关,只是一些您也应该解决的问题 我已经用这个插件测试了你的代码,效果很好 <div id="logoPa

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

Html:


每个iframe加载都没有刷新,至少据我所知没有。 我在HTML中看到的唯一问题是类似的ID属性(“test”),它与刷新无关,只是一些您也应该解决的问题

我已经用这个插件测试了你的代码,效果很好

<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>