我正在为一位朋友在网站上工作,并试图在幻灯片放映中为每个图像添加一个链接。幻灯片演示使用jQuery和一个名为easySlider1.7.js的脚本。如果图像单独存在,一切都可以正常工作,但是当我尝试用链接包装图像时,幻灯片不再按照他们的要求进行。下面是活的网站时显示问题...添加一个链接图像打破jQuery的滑块,请帮助!
下面是每个幻灯片图像的HTML代码...
<div class="covercontent2box">
<div class="covercontent2">
<div id="slideshow">
<a href="/ashton-jacket-p-107.html"><img src="img/homepagesummer2010_2.2-cut.jpg" class="active" /></a>
<a href="/carly-coverup-p-106.html"><img src="img/homepagesummer2010_3.2-cut.jpg" /></a>
<a href="/shop-online-bottoms-c-15_14.html"><img src="img/homepagesummer2010_1.2-cut.jpg" /></a>
</div>
</div>
</div>
这里是jQuery代码上控制滑块的页面...
<script type="text/javascript">
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ($active.length == 0) $active = $('#slideshow IMG:last');
// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval("slideSwitch()", 4500);
});
</script>
有没有人有任何想法为什么向图像添加链接标签会打破滑块?任何帮助或指导提供将不胜感激。
感谢,
德文
好吧我无法在这里发布文件内容,所以我上传了索引文件以及easyslider1.7.js文件到这里:http://www.devinlewis.com/files.zip。您应该能够下载zip文件并打开相关文件。非常感谢。 – lewisqic 2010-05-07 04:08:53