(function($) { $.extend($.browser, { client: function() { return { width: document.documentelement.clientwidth, height: document.documentelement.clientheight, bodywidth: document.body.clientwidth, bodyheight: document.body.clientheight } }, scroll: function() { return { width: document.documentelement.scrollwidth, height: document.documentelement.scrollheight, bodywidth: document.body.scrollwidth, bodyheight: document.body.scrollheight, left: document.documentelement.scrollleft + document.body.scrollleft, top: document.documentelement.scrolltop + document.body.scrolltop } }, screen: function() { return { width: window.screen.width, height: window.screen.height } }, isie6: $.browser.msie && $.browser.version == 6, isminw: function(val) { return math.min($.browser.client().bodywidth, $.browser.client().width) <= val }, isminh: function(val) { return $.browser.client().height <= val } }) }) (jquery); (function(a) { a.fn.jdslide = function(k) { var p = a.extend({ width: null, height: null, pics: [], index: 0, type: "num", current: "curr", delay1: 100, delay2: 5000 }, k || {}); var i = this; var g, f, d, h = 0, e = true, b = true; var n = p.pics.length; var o = function() { var q = ""; i.css({ position: "relative" }).html(q); i.find("ul").css({ width: n * p.width + "px", height: p.height + "px" }); a(function() { c() }) }; o(); var j = function() { var s = []; s.push("
"); var r; var q; for (var t = 0; t < n; t++) { r = (t == p.index) ? p.current: ""; switch (p.type) { case "num": q = t + 1; break; case "string": q = p.pics[t].alt; break; case "image": q = ""; default: break } s.push(""); s.push(q); s.push("") } s.push("
"); i.append(s.join("")); var x = []; x.push("
"); i.append(x.join("")); i.find("#goback").bind("mouseover", function() { b = false; cleartimeout(g); cleartimeout(d) }).bind("click", function() { var u = p.index - 1; if (u < 0) { u = t - 1 }; l(u) }).bind("mouseleave", function() { b = true; }); i.find("#forward").bind("mouseover", function() { b = false; cleartimeout(g); cleartimeout(d) }).bind("click", function() { var u = p.index + 1; l(u) }).bind("mouseleave", function() { b = true; }); i.find("span").bind("mouseover", function() { b = false; cleartimeout(g); cleartimeout(d); var u = i.find("span").index(this); if (p.index == u) { return } else { d = setinterval(function() { if (e) { l(u) } }, p.delay1) } }).bind("mouseleave", function() { b = true; cleartimeout(g); cleartimeout(d); g = settimeout(function() { l(p.index + 1, true) }, p.delay2) }); i.bind("mouseover", function() { $("#ebaduslide .o-control").show() }).bind("mouseleave", function() { $("#ebaduslide .o-control").hide() }) }; var l = function(r, q) { if (r == n) { r = 0 } f = settimeout(function() { i.find("span").eq(p.index).removeclass(p.current); i.find("span").eq(r).addclass(p.current); m(r, q) }, 20) }; var m = function(u, q) { var s = parseint(h); var v = math.abs(s + p.index * p.width); var t = math.abs(u - p.index) * p.width; var r = math.ceil((t - v) / 4); if (v == t) { cleartimeout(f); if (q) { p.index++; if (p.index == n) { p.index = 0 } } else { p.index = u } e = true; if (e && b) { cleartimeout(g); g = settimeout(function() { l(p.index + 1, true) }, p.delay2) } } else { if (p.index < u) { h = s - r; i.find("ul").css({ left: h + "px" }) } else { h = s + r; i.find("ul").css({ left: h + "px" }) } e = false; f = settimeout(function() { m(u, q) }, 20) } }; var c = function() { var q = []; for (var r = 1; r < n; r++) { q.push("
  • ") } i.find("ul").append(q.join("")); g = settimeout(function() { l(p.index + 1, true) } , p.delay2); if (p.type) { j() } } } })(jquery); //jquery(function ($) { // if ( jquery.browser.msie && ( jquery.browser.version == "6.0" ) && !jquery.support.style ){ // jquery('div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section').hover(function(){ // jquery(this).addclass('hover'); // },function(){ // jquery(this).removeclass('hover'); // }); // } //}); $(document).ready(function() { var totwidth = 0; var positions = new array(); var pwidth = $("#gallerys").width(); //alert(pwidth); $("#downloadwrap").css('visibility', 'hidden'); $(".slides").width(pwidth); $('#slidess .slides').each(function(i) { positions[i] = totwidth; var f = pwidth - 980; totwidth += (980 + f); if (!$(this).width()) { return false; } }); $(window).resize(function() { totwidth = 0; positions = new array(); pwidth = $("#gallerys").width(); $(".slides").width(pwidth); $('#slidess .slides').each(function(i) { positions[i] = totwidth; var f = pwidth - 980; totwidth += (980 + f); if (!$(this).width()) { return false; } }); $('#slidess').width(totwidth).stop().animate({ marginleft: -positions[0] + 'px' }, 0); }); $('#slidess').width(totwidth); var timer = null; function onseconddelay(callback) { cleartimeout(timer); timer = settimeout(callback, 500); } $('.switch ul li').mouseover(function() { var _this = $(this); onseconddelay(function() { _this.find('a').trigger('hover', [true]) }); }).mousemove(function() { var _this = $(this); onseconddelay(function() { _this.find('a').trigger('hover', [true]) }); }).mouseout(function() { cleartimeout(timer); }); $('.switch ul li a').mouseover(function(e, keepscroll) { $('li.menuitems').removeclass('currbdbanners'); //$(this).parent().addclass('currbdbanners'); var li_id = $(this).parent().attr('id'); var li_id_num = li_id.split('_')[2]; //console.log(li_id_num); $("#t_li_" + li_id_num).addclass('currbdbanners'); if ("1" == li_id_num || "4" == li_id_num) { $("#downloadwrap").css('visibility', 'hidden'); if ("1" == li_id_num) { $("#special2").show(); $("#special").hide(); } if ("4" == li_id_num) { $("#special2").hide(); $("#special").show(); } } else { $("#downloadwrap").css('visibility', ''); $("#special").hide(); $("#special2").hide(); } var pos = $(this).parent().prevall('.menuitems').length; console.log(pos); $('#slidess').stop().animate({ marginleft: -positions[pos] + 'px' }, 450); e.preventdefault(); if (!keepscroll) clearinterval(itvl); }); $('.switch ul li.menuitems:first').addclass('currbdbanners'); var current = 1; function autoadvance() { if (current == -1) return false; $('.switch ul li a').eq(current % $('.switch ul li a').length).trigger('click', [true]); current++; } var changeevery = 7; var itvl = setinterval(function() { autoadvance() }, changeevery * 600); console.log(positions); window.index = 0; var auto; var slider = function(obj) { //滑动函数 $('#slidess').stop().animate({ marginleft: -positions[obj] + 'px' }, 450); }; window.active = function() { var liwidth = $("#storeimgss li").width(); $("#storeimgss li").removeclass("flashhover"); $($("#storeimgss li").get(index)).addclass("flashhover"); $("#storeimgss li .jts").css({ "display": "none" }); $($("#storeimgss li .jts").get(index)).css({ "display": "block" }); slider(index); //切换图片 }; window.set = function(event) { //自动切换 auto = setinterval(function() { index = (++index) % $("#storeimgss li").length; active(); }, 4000); }; window.clear = function() { //清楚自动切换 clearinterval(auto); }; /***************************update end***********************/ $("#storeimgss li").hover(function() { window.index = $("#storeimgss li").index(this); clear(); // active(); set(); }, function() {}); /* $("#storeimgss li").mouseout(function(){ window.index=$("#storeimgss li").index(this); set(); }); */ /***************************update end***********************/ if ($("#storeimgss li").length > 1) { set(); } }); // 八度整站切换tab function settab(name, cursel, n) { for (i = 1; i <= n; i++) { var menu = document.getelementbyid(name + i); var con = document.getelementbyid("ebadu_" + name + "_" + i); menu.classname = i == cursel ? "hover": ""; con.style.display = i == cursel ? "block": "none"; } }