Php 幻灯片jquery显示加载时的所有图像
我有一个jquery的幻灯片。但当我向图片添加超链接时,滑块会在加载时显示gallery中的所有图片 我需要更改脚本吗Php 幻灯片jquery显示加载时的所有图像,php,jquery,slideshow,Php,Jquery,Slideshow,我有一个jquery的幻灯片。但当我向图片添加超链接时,滑块会在加载时显示gallery中的所有图片 我需要更改脚本吗 <script type="text/javascript"> $(document).ready(function(){ var images = "#gallery img" // image selector , interval = 4000 // milli
<script type="text/javascript">
$(document).ready(function(){
var
images = "#gallery img" // image selector
, interval = 4000 // milliseconds between transitions
, index = 0 // starting index
, count = $(images).length // image count
// the transition loop
, handle = setInterval(function() {
// fade out the current image
$(images + ":eq(" + index + ")").fadeOut('slow');
// get the next index, or cycle back to 0
if (++index === count) index = 0;
// fade in the next image
$(images + ":eq(" + index + ")").fadeIn('slow');
}
, interval
)
, stop = function(){
clearInterval(handle);
};
});
</script>
<div id="gallery">
<a href="hyperlink"><img class="active" src="image"></a>
<a href="hyperlink"><img src="image"></a>
</div>
$(文档).ready(函数(){
变量
images=“#画廊img”//图像选择器
,转换之间的间隔=4000//毫秒
,index=0//开始索引
,计数=$(图像)。长度//图像计数
//过渡回路
,handle=setInterval(函数(){
//淡出当前图像
$(图像+”:等式(“+索引+”)。淡出('slow');
//获取下一个索引,或循环回0
如果(++索引===计数)索引=0;
//在下一个图像中淡入淡出
$(图像+”:eq(“+index+”).fadeIn('slow');
}
间隔
)
,停止=函数(){
间隙(手柄);
};
});