1

我正在使用响应式滑块,它不会在悬停时停止,我不明白为什么,这是我的脚本告诉它在悬停时暂停

<script type='text/javascript'>
 $(function () {
    $(&quot;.rslides&quot;).responsiveSlides({
  timeout: 8000,                  
  pause: true, 
});
  });
</script>

这是实现它的页面的现场演示http://bloghutsbeta.blogspot.com/2012/04/testing-slider.html

相关标记:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src='http://files.cryoffalcon.com/javascript/responsiveslides.min.js' type='text/javascript'/>

HTML:

<ul class="rslides">
<li><img width="660" height="400" src="http://responsive-slides.viljamis.com/1.jpg" alt="" /></li>
<li><img width="660" height="400" src="http://responsive-slides.viljamis.com/2.jpg" alt="" /></li>
<li><img width="660" height="400" src="http://responsive-slides.viljamis.com/3.jpg" alt="" /></li>
</ul>

CSS:

.rslides {
  position: relative;
  list-style: none;
  overflow: hidden;
  width: 660px;
  padding: 0;
  margin: 0;
height:400px;
  }

.rslides li {
  position: absolute;
  width: 660px;
height:400px;
  left: 0;
  top: 0;
  }

.rslides li:first-child {
  position: relative;
  display: block;
  float: left;
  }

.rslides img {
  display: block;
  height: auto;
  float: left;
  width: 660px;
height:400px;
  border: 0;
  }

编辑:链接到这个插件的创建者的页面http://responsive-slides.viljamis.com/

4

2 回答 2

6
<script type='text/javascript'>
 $(function () {
    $(".rslides").responsiveSlides({//use quotes
  timeout: 8000,                  
  pause: true//trailing comma taken out 
});
  });
</script>
于 2012-04-28T18:14:36.353 回答
0

问题是您使用的是该插件的 1.23 版,并且如 GitHub 上的更改日志中所述,该选项已在 1.3 版中添加。看看这里并下载最新版本:https ://github.com/viljamis/ResponsiveSlides.js

于 2012-05-02T19:28:51.247 回答