"; for (var i = 0; i < len; i++) { btn += "" + (i + 1) + ""; } btn += "
"; $("#focus").append(btn); $("#focus .btnBg").css("opacity", 0.5); //为小按钮添加鼠标滑入事件,以显示相应的内容 $("#focus .btn span").css("opacity", 0.4).mouseenter(function () { index = $("#focus .btn span").index(this); showPics(index); }).eq(0).trigger("mouseenter"); //上一页、下一页按钮透明度处理 $("#focus .preNext").css("opacity", 0.2).hover(function () { $(this).stop(true, false).animate({ "opacity": "0.5" }, 300); }, function () { $(this).stop(true, false).animate({ "opacity": "0.2" }, 300); }); //上一页按钮 $("#focus .pre").click(function () { index -= 1; if (index == -1) { index = len - 1; } showPics(index); }); //下一页按钮 $("#focus .next").click(function () { index += 1; if (index == len) { index = 0; } showPics(index); }); //本例为左右滚动,即所有li元素都是在同一排向左浮动,所以这里需要计算出外围ul元素的宽度 $("#focus ul").css("width", sWidth * (len)); //鼠标滑上焦点图时停止自动播放,滑出时开始自动播放 $("#focus").hover(function () { clearInterval(picTimer); }, function () { picTimer = setInterval(function () { showPics(index); index++; if (index == len) { index = 0; } }, 4000); //此4000代表自动播放的间隔,单位:毫秒 }).trigger("mouseleave"); //显示图片函数,根据接收的index值显示相应的内容 function showPics(index) { //普通切换 var nowLeft = -index * sWidth; //根据index值计算ul元素的left值 $("#focus ul").stop(true, false).animate({ "left": nowLeft }, 300); //通过animate()调整ul元素滚动到计算出的position $("#focus .btn span").removeClass("on").eq(index).addClass( "on"); //为当前的按钮切换到选中的效果 $("#focus .btn span").stop(true, false).animate({ "opacity": "0.4" }, 300).eq(index).stop(true, false).animate({ "opacity": "1" }, 300); //为当前的按钮切换到选中的效果 } });
Produced By 大汉网络 大汉版通发布系统

更多阅读

以下内容与「九游娱乐(中国)官方网站」同属公开资讯,可按栏目接着查阅相关条目。 继续了解

本站按公开材料组织页面。需要原文时请核对应栏目发布页。

列表适合快速定位,正文适合核对表述。 更多阅读两者都保留在站内即可形成完整阅读路径。

九游娱乐官方教师工作司关于遴选首批九游娱乐官方级职业九游娱乐app下载教师教... | 发展规划与审计党支部召开支部党... | 九游娱乐app下载建设资讯(第七十二期... | 日照九游娱乐app下载揭牌 | 山东省职业九游娱乐app下载条例 | 九游娱乐app下载建设资讯(第六十八期... | 广播电视大学服务“三农”四十... 更多阅读

栏目导航

主页

页面按栏目组织。可先看导读,再进入相关篇目或返回列表。