我发现了一个jquery图像旋转脚本,并添加了图像的超链接打破了动画 [英] I found a jquery image rotatation script and adding hyperlinks to the images breaks the animation

查看:121
本文介绍了我发现了一个jquery图像旋转脚本,并添加了图像的超链接打破了动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发现这篇关于使用jquery进行图像交换的精彩文章:

Found this great article on using jquery for image swapping:

http://jquery-howto.blogspot.com/2009/05/replacing-images-at-time-intervals.html

你如何建议我超链接图像?

How do you suggest I hyperlink the images?

推荐答案

解决它:

function swapImages() {
    var $active = $('#myGallery a:has(img) > img.active');
    var $next = ($('#myGallery a:has(img.active)').next().find('img').length > 0) ? $('#myGallery a:has(img.active)').next().find('img') : $('#myGallery a:has(img):first > img');
    $active.fadeOut(function() {
        $active.removeClass('active');
        $next.fadeIn().addClass('active');
    });
}

这篇关于我发现了一个jquery图像旋转脚本,并添加了图像的超链接打破了动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆