您好,欢迎来到jQuery吧!QQ群:193687763(钱端开发)

jQuery吧-Write Less, Do More | 注重前端开发

首页 > jQuery > jQuery特效 > jQuery焦点图幻灯片特效 > 正文

hao123军事频道首页JQ焦点图特效

2015-04-27 10:04:06 作者:天外飞仙 人气:774 Views

hao123军事频道首页JQ焦点图特效
20150416224338
部分 jQuery代码

!function(t) { t("div[data-scro='controler'] b,div[data-scro='controler2'] a").click(function() { var a = t(this); return "down" == a.attr("class") ? !1 : (n.st({ findObject: a, main: a.parent().parent().find("div[data-scro='list']"), pagSource: a.parent().parent().find("div[data-scro='controler'] b"), className: "down", duration: "slow", on: "A" == t(this)[0].tagName ? !0 : !1 }), !1) }); var a = "", e = !0, n = { init: function() { this.start(), this.time() }, st: function(t) { e && (this.animate(t.findObject, t.main, t.className, t.duration, t.pagSource, t.on), e = !1) }, animate: function(a, i, o, r, s, c) { var d = c ? s.parent().find("*[class='" + o + "']") : a.parent().find(a[0].tagName + "[class='" + o + "']"), l = d.index(), u = c ? "next" == a.attr("class") ? l + 1 : l - 1 : a.index(), f = i.find(".item"), m = 1; d.removeClass(o), c ? ( - 1 == u && (u = f.size() - 1), u == f.size() && (u = 0), s.eq(u).addClass(o)) : a.addClass(o), ("prev" == a.attr("class") || l > u) && (m = !1), ("next" == a.attr("class") || u > l) && "prev" != a.attr("class") && (m = !0), m ? "": f.eq(u).css("left", -i.width()), f.eq(l).animate({ left: m ? -i.width() : i.width() }, r, function() { t(this).removeAttr("style"), e = !0 }); var v = f.eq(u).find("img"); n.eachimg(v), f.eq(u).animate({ left: "0px" }, r) }, start: function() { t("#focus_image div[data-scro='controler'] b,#focus_image div[data-scro='controler2'] a").mouseover(function() { window.clearInterval(a) }).mouseout(function() { n.time() }) }, time: function() { a = window.setInterval(function() { var a = t("#focus_image div[data-scro='controler'] *[class='down']").index(), e = t("#focus_image div[data-scro='list'] .item"); e.eq(a).animate({ left: -t("#focus_image div[data-scro='list']").width() }, "slow", function() { t(this).removeAttr("style"), t("#focus_image div[data-scro='controler'] b").removeClass("down").eq(a).addClass("down") }), a++, a == e.size() && (a = 0); var i = e.eq(a).find("img"); n.eachimg(i), e.eq(a).animate({ left: "0px" }, "slow") }, 4e3) }, eachimg: function(a) { t.each(a, function(a, e) { var e = t(e); e.attr("src") != e.attr("data-src") && void 0 != e.attr("data-src") && e.attr("src", e.attr("data-src")) }) } }; t("a").click(function() { t(this).blur() }), n.init()} (this.jQuery || this.baidu),function(t) { t("div[log-type]").bind("mousedown", function(e) { var n = t(this).attr("log-type"), i = t(this).attr("id"), e = e || window.event, o = e.srcElement || e.target; ("A" == o.tagName.toUpperCase() && n || "A" == o.parentNode.tagName.toUpperCase() && n) && a.send(n, i) }); var a = { send: function(t, a) { var e = "s_" + new Date / 1, n = window[e] = new Image; n.onload = n.onerror = function() { window[e] = null }, n.src = "../images/track.gif?level=2&page=hao123-erji-junshi&id=" + a + "&type=module-click&area=" + encodeURIComponent(encodeURIComponent(t)) + "&v=" + new Date / 1, n = null } }, e = t("#news").attr("resource"); e && a.send(e, "junshi")} (this.jQuery),function() { var t = $("#redianpinglun .box"), a = t.size(), e = 0; $("#change_btn").on("click", function() { e != a - 1 ? e++:e = 0; var n = t.eq(e).find("img"); t.hide().eq(e).fadeIn("fast"), n.attr("src", n.attr("data-src")) })} (jQuery);

下载地址
预览地址

链接:http://www.jqueryba.com/5550.html(转载时请注明本文出处及文章链接)

jQuery吧-Write Less, Do More | 注重前端开发

jQuery吧-Write Less, Do More | 注重前端开发

Copyright © 2013 jqueryba.com, All Rights Reserved.奔跑在阿里云

免责声明:本站所有内容来源于互联网。如果本站部分内容侵犯您的权益,请您告知,站长会立即处理 苏ICP备12059471号

站内所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!