微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

非常棒的jQuery图片轮播效果

本文实例为大家分享了jQuery图片轮播效果,很个性,具体内容如下

购物产品展示:图片轮播器,效果如下所示:

思路说明:

每隔一段时间,实现图片自动切换及选项卡选中效果

两个区域:

   最外层容器区域,如上图红色线框矩形

   选项卡区域

   鼠标悬浮或鼠标划入mouSEOver

   鼠标离开mouseleave

rush:xhtml;"> /**大屏广告滚动样式**/ <Meta charset="UTF-8"> jQuery个性化<a href="https://www.jb51.cc/tag/tupian/" target="_blank" class="keywords">图片</a>轮播<a href="https://www.jb51.cc/tag/xiaoguo/" target="_blank" class="keywords">效果</a>

rush:css;"> #jnImageroll{ width:550px; height:321px; overflow: hidden; position: relative; } #jnImageroll img{ position: absolute; left: 0; top: 0; } #jnImageroll div{ position: absolute; left: 0; bottom: 0; }

jnImageroll div a{

width: 79px;
background: #444444;
float: left;
display: inline-block;
margin-right: 1px;
text-align: center;
padding: 5px 15px;
text-decoration: none;
color: #FFFFFF;
font: 14px/1.5 tahoma,arial;
}

jnImageroll div a em{

display: block;/将行内元素变成块级元素/
height: 19px;
overflow: hidden;
}

jnImageroll a.chos {

background: #37A7D7;
color: #FFFFFF;
}

<div class="jb51code">
<pre class="brush:js;">
/ 首页大屏广告效果 /
$(function(){
var $imgrolls = $("#jnImageroll div a");//选项卡区域
$imgrolls.css("opacity","0.7"); //设置选项卡透明度
var len = $imgrolls.length;
var index = 0;
var adTimer = null;
//选项卡的鼠标悬浮、离开调用函数
$imgrolls.mouSEOver(function(){
index = $imgrolls.index(this);
showImg(index);
}).eq(0).mouSEOver();

//滑入 停止动画,滑出开始动画.
$('#jnImageroll').hover(function(){
if(adTimer){
clearInterval(adTimer);
}
},function(){
adTimer = setInterval(function(){
showImg(index);
index++;
if(index==len){index=0;}
},5000);
}).trigger("mouseleave");
})
//显示不同的幻灯片
function showImg(index){
var $rollobj = $("#jnImageroll");
var $rolllist = $rollobj.find("div a");
var newhref = $rolllist.eq(index).attr("href");
$("#JS_imgWrap").attr("href",newhref)
.find("img").eq(index).stop(true,true).fadeIn().siblings().fadeOut();
$rolllist.removeClass("chos").css("opacity","0.7")
.eq(index).addClass("chos").css("opacity","1");
}

以上就是很有个性的jQuery图片轮播效果,希望大家喜欢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


jQuery表单验证提交:前台验证一(图文+视频)
jQuery表单验证提交:前台验证二(图文+视频)
jQuery如何实时监听获取input输入框的值
JQuery怎么判断元素是否存在
jQuery如何实现定时重定向
jquery如何获取复选框选中的值
jQuery如何清空form表单数据
jQuery怎么删除元素节点
JQuery怎么循环输出数组元素
jquery怎么实现点击刷新当前页面