/**************** ǰ̨ҳ�湫�õ�js���� *******************/ // swf����һ����վȫ�ֵķ��������洢ǰ̨��վ�ĸ�����������websitefunction wsf = {} wsf.f = { //�����ժ��� s_j: function(st) { //�ַ���ת����json if (!!st) { var j = "{" + st + "}"; j = eval('(' + j + ')'); return j; } else { j = {}; return j; } }, j_s: function(j) { //��jsonת�����ַ��� var x = []; for (i in j) { x.push(i + ":" + j[i]); } return x.join(","); } }; // վ�㵼���ķ���,��ҫ��������ʾ�������ӵ����˵��� wsf.nav = function(){ $("#nav").on({ mouseenter: function() { var that = $(this), sub = that.find("div.nsub"); if (sub.length) { that.addclass('nitemsub'); var l = that.offset().left, pl = sub.width() + l; if (pl > $(document).width()) { sub.css({ left: 'auto', right: 0 }); } } if(!that.hasclass('nitemcur')){ that.addclass("nitemh"); } }, mouseleave: function() { $(this).removeclass("nitemh"); $(this).removeclass("nitemsub"); } }, '.nitem'); }; /*��վ��logo search shopcart λ�ü���*/ // wsf.hoffl = function(){ // var logo = $("#logo"),searchs = $("#search"),shopcart = $("#shopping_car"),webnav = $('#web_nav'), // hcl = math.floor(($("body").width() - usersitewidth)/2); // logo.css({'left': parseint(logo.css('left')) + hcl}); // searchs.css({'left': parseint(searchs.css('left')) + hcl}); // shopcart.css({'left': parseint(shopcart.css('left')) + hcl}); // if(parseint(webnav.css('left')) > 0){ // webnav.css({'left': parseint(webnav.css('left')) + hcl}); // } // }; /*��վ��logo search shopcart λ�ü���*/ wsf.hoffl = function(){ var j = 0; var p = function(obj,t){ if(t == 'n'){ if(obj.attr('data-l')){ j = wsf.f.s_j(obj.attr('data-l')); } }else{ if(obj.attr('data-s')){ j = wsf.f.s_j(obj.attr('data-s')); } } }; var logo = $("#logo"),searchs = $("#search"),shopcart = $("#shopping_car"),webnav = $('#web_nav'); var hcl = math.floor(($("body").width() - usersitewidth)/2); if(logo.length){ p(logo); logo.css({'left': j.l + hcl}); } if(searchs.length){ p(searchs); searchs.css({'left': j.l + hcl}); } if(shopcart.length){ p(shopcart); shopcart.css({'left': j.l + hcl}); } if(webnav.length){ p(webnav,'n'); if(j.p == 1 || j.p == 3){ webnav.css({'left': j.l + hcl}); } } }; // �������û���logo,search,shopping�ϱ߾ඨλ wsf.hofft = function(){ var logo = $("#logo"),searchs = $("#search"),shopcar = $("#shopping_car"), logot = parseint(logo.css('top')),searcht = parseint(searchs.css('top')),shopcart = parseint(shopcar.css('top')),toph = $("#top_area").outerheight(); logo.css({top : logot + toph +'px'}); searchs.css({top : searcht + toph +'px'}); shopcar.css({top : shopcart + toph +'px'}); }; /* fixedshopcar ��ҫ������ʾǰ̨�ĸ������ﳵ������ߵ�һщ���� */ wsf.fixedshopcar = function(){ var fixedshopcar = $("#fixedshopcar"), shopcaralert = fixedshopcar.find("div.shopcar-alert"), listbody = fixedshopcar.find("dd.shopcar-list-body"), listul = listbody.find(".shopcar-list-ul"); listbody.cscroll({ w: 10, tbb: false }); fixedshopcar.on({ click: function() { var that = $(this); if (that.data("alertshow") == 1) { that.removedata("alertshow"); shopcaralert.css({ 'visibility': 'hidden' }); } else { that.data("alertshow", 1); shopcaralert.css({ 'visibility': 'visible' }); } } }, ".shopcar-icon"); fixedshopcar.on({ click: function() { fixedshopcar.find(".shopcar-icon").removedata("alertshow"); shopcaralert.css({ 'visibility': 'hidden' }); } }, ".shopcar-alert-close"); listul.on({ click: function() { var par = $(this).parent().parent(); par.animate({ height: 0, opacity: 0 }, 500, function() { $(this).remove(); if (listul.height() > listbody.height()) { listbody.cscroll({ w: 10, tbb: false }); } else { listbody.cscroll({ w: 10, tbb: false }); listbody.find(".c-scrollbar").hide(); } }); } }, "span.span-option a"); }; /* focus-pic-module createdate:2015/04/02 ģ���ڽ���ͼ��������ҫ��ģ���еľ���ͼ�л����� */ wsf.focuspicmodule = function(){ $("div.focus-pic-module").each(function() { var obj = $(this); var h = obj.parent().height(), w = obj.parent().width(), dd = obj.find("dd"), dl = obj.find("dl"), type = obj.data("type"), dir = obj.data("dir"), sum = dd.length, curi = 0, ni = curi + 1, times, move, fun; dl.css({ "width": w + "px", "height": h + "px", "overflow": "hidden" }); dd.css({ "width": w + "px", "height": h + "px" }); //�ж����õķ��� (function() { var scss; switch (dir) { case 1: //left scss = { left: (w + 10) + "px", top: 0 }; break; case 2: //right scss = { left: -(w + 10) + "px", top: 0 }; break; case 3: //top scss = { top: (h + 10) + "px", left: 0 }; break; case 4: //bottom scss = { top: -(h + 10) + "px", left: 0 }; break; } dd.each(function() { var that = $(this); if (that.index() != curi) { that.css(scss); } else { that.css({ left: 0, top: 0 }); } }); })(); //�ж����õ����� if (sum > 1) { (function() { switch (type) { case 1: case 2: var controls = $('
'); for (var s = 0; s < sum; s++) { if (type == 1) { var span = $('' + (s + 1) + ''); if (s === curi) { span = $('' + (s + 1) + ''); } } else if (type == 2) { var span = $(''); if (s === curi) { span = $(''); } } controls.append(span); } obj.append(controls); fun = function(i) { obj.find(".focus-controls-list span:eq(" + i + ")").addclass("cur").siblings().removeclass("cur"); } obj.on({ click: function() { var indexs = $(this).index(); if (indexs != curi) { if (!obj.data("move")) { move(indexs); } } } }, ".focus-controls-list span"); break; case 3: var nextbtn = $(''), prevbtn = $(''); obj.append(nextbtn, prevbtn); obj.on({ mouseenter: function() { var this_ = $(this); if (!this_.data("type3btn")) { obj.find(".focus-pic-next,.focus-pic-prev").css({ visibility: 'visible' }); this_.data("type3btn", 1); } }, mouseleave: function() { var this_ = $(this); if (this_.data("type3btn") == 1) { obj.find(".focus-pic-next,.focus-pic-prev").css({ visibility: 'hidden' }); this_.removedata("type3btn"); } } }); fun = function(i) { obj.find(".focus-pic-next").data("num", i + 1); obj.find(".focus-pic-prev").data("num", i - 1); }; fun(curi); obj.find(".focus-pic-next").on("click", function() { if (!obj.data("move")) { move($(this).data('num')); } }); obj.find(".focus-pic-prev").on('click', function() { if (!obj.data("move")) { move($(this).data('num')); } }); break; } })(); //�ƶ����� function move(c) { if (c == sum) { c = 0; } if (c < 0) { c = sum - 1; } obj.data("move", 1); var chnum = function() { curi = c; ni = c + 1; obj.data("move", 0); }; if (dir == 1) { $(dd[c]).animate({ left: 0 }, 1000, function() { chnum(); }); $(dd[curi]).animate({ left: -w }, 1000, function() { $(this).css({ left: (w + 10) + "px" }); }) } if (dir == 2) { $(dd[c]).animate({ left: 0 }, 1000, function() { chnum(); }); $(dd[curi]).animate({ left: w }, 1000, function() { $(this).css({ left: -(w + 10) + "px" }); }) } if (dir == 3) { $(dd[c]).animate({ top: 0 }, 1000, function() { chnum(); }); $(dd[curi]).animate({ top: -(h + 10) }, 1000, function() { $(this).css({ top: (h + 10) + "px" }); }) } if (dir == 4) { $(dd[c]).animate({ top: 0 }, 1000, function() { chnum(); }); $(dd[curi]).animate({ top: h + 10 }, 1000, function() { $(this).css({ top: -(h + 10) + "px" }); }) } fun(c); } var settime = function() { times = setinterval(function() { move(ni); }, 5000); }; obj.on({ mouseenter: function() { clearinterval(times); }, mouseleave: function() { settime(); } }); settime(); } }); }; /* text-list-module\pic-text-list-module createdate:2015/07/20 �ı��б��ͼ����ϣ�б�ģ��ķ��� */ wsf.textlistmodule = function(){ $("div.text-list-module,div.pic-text-list-module").on({ mouseenter : function(){ $(this).addclass("lihover"); }, mouseleave : function(){ $(this).removeclass("lihover"); } },"li"); }; /* cataloglist ���η���ŀ¼��ҫ��ģ��ķ���ŀ¼js�����������ƶ� */ wsf.cataloglist = function() { var cataloglist = $("div.cataloglist"); var catalogh = function(obj) { var onedl = obj.children("dl.oneclasslist"); if (obj.height() < onedl.height() || parseint(onedl.css("margin-top"), 10) < 0) { obj.find("big.but").show(); } else { obj.find("big.but").hide(); } }; var move = function(obj, dir) { var onedl = obj.find("dl.oneclasslist"), t_h = obj.height(), dl_t = math.abs(parseint(onedl.css("margin-top"), 10)), dl_sh = onedl.height() - dl_t, judge; if (dir == 'up') { judge = (dl_sh - t_h) > 0 ? true : false; } else if (dir == 'down') { judge = dl_t > 0 ? true : false; t_h = -t_h; } if (judge) { if (onedl.data('moving') != 1) { onedl.data('moving', 1); onedl.animate({ margintop: -(dl_t + t_h / 3) }, 500, function() { onedl.removedata('moving', 1); }); } } } cataloglist.each(function() { var that = $(this); that.css({ height: that.parent().height() + "px", width: that.parent().width() + "px" }); //������չ���պ������¼� that.on({ click: function() { var this_ = $(this), pdt = this_.parent().parent(), num; if (pdt.hasclass('oneclasst')) { num = 'one' } else if (pdt.hasclass('twoclasst')) { num = 'two' } else if (pdt.hasclass('threeclasst')) { num = 'three' } if (this_.hasclass('open')) { pdt.removeclass(num + 'classtopen').next("dd").removeclass(num + 'classcopen'); this_.removeclass("open"); } else { pdt.addclass(num + 'classtopen').next("dd").addclass(num + 'classcopen'); this_.addclass("open"); } catalogh(that); } }, "dt code"); that.on({ mouseenter : function(){ var pdt = $(this); if (pdt.hasclass('oneclasst')) { num = 'one' } else if (pdt.hasclass('twoclasst')) { num = 'two' } else if (pdt.hasclass('threeclasst')) { num = 'three' } pdt.addclass(num + 'classthover'); }, mouseleave : function(){ var pdt = $(this); if (pdt.hasclass('oneclasst')) { num = 'one' } else if (pdt.hasclass('twoclasst')) { num = 'two' } else if (pdt.hasclass('threeclasst')) { num = 'three' } pdt.removeclass(num + 'classthover'); } },"dt") // �����°�ť���¼� that.on({ click: function() { if ($(this).hasclass('upbut')) { move(that, 'down'); } else if ($(this).hasclass('downbut')) { move(that, 'up'); } } }, "big.but"); // ��Ԫ�ر�����¼� that.on({ mouseenter: function() { var this_ = $(this); this_.css({ height: this_.parent().height() + "px", width: this_.parent().width() + "px" }); var dl = this_.find("dl.oneclasslist"), dl_h = dl.height(), t_h = this_.height(); if (dl_h > t_h || parseint(dl.css("margin-top"), 10) < 0) { this_.find("big.but").show(); } }, mouseleave: function() { $(this).find("big.but").hide(); } }) }); }; /* menu-catalog-module �����ͷ���ŀ¼��ҫ����չʾ������� */ wsf.menucatalogmodule = function() { $("div.menu-catalog-module").each(function() { var menucatalog = $(this), thatp, mo, moid, catalog, leveobj, hidetimefun, hidecatalog = function() { hidetimefun = settimeout(function() { leveobj.removeclass('one-class-hover'); catalog.css("width", 0); }, 500); }; menucatalog.on({ mouseenter: function() { }, mouseleave: function() { hidecatalog(); } }) menucatalog.on({ mouseenter: function() { cleartimeout(hidetimefun); leveobj = $(this); $(this).addclass("one-class-hover").siblings('dd').removeclass('one-class-hover'); var indexs = leveobj.index(), that_t = leveobj.position().top, that_h = leveobj.outerheight(), inner = leveobj.find(".one-class-inner"), inner_mt = parseint(inner.css("margin-top")), inner_tbw = parseint(inner.css("bordertopwidth")), inner_h = inner.innerheight(); thatp = leveobj.parent().parent(); mo = leveobj.parents("div.mo"); moid = mo.attr("id"); catalog = $("#menucatalogmore_" + moid.substr(3)); catalog.off().on({ mouseenter: function() { cleartimeout(hidetimefun); }, mouseleave: function() { hidecatalog(); } }) var l = thatp.offset().left, t = thatp.offset().top, gap = catalog.find("big.gap"), gap_h = inner_h, gap_t = that_t + inner_tbw + inner_mt, moreinner = catalog.find(".catalog-more-inner"), morelist = catalog.find(".catalog-more-list:eq(" + indexs + ")"); l = l + thatp.width() - 2; gap.css({ height: gap_h + "px", top: gap_t + "px" }); morelist.siblings().hide(); if(morelist.find("dl").length >= 1){ morelist.show(); catalog.css({visibility:'visible'}); }else{ catalog.css({visibility:'hidden'}); } moreinner.css({ minheight: gap_h + "px", margintop : gap_t - inner_tbw + 'px' }); catalog.css({ left: l + "px", top: t + "px" }).animate({ width: moreinner.outerwidth() }, 200, function() { catalog.css({ width: "auto" }); }); }, mouseleave: function() { //$(this).removeclass("one-class-hover"); } }, "dd.one-class"); }); }; /* tablemodule createdate:2015/05/11 ������������class */ wsf.tablemodule = function() { var tablemodule = $('div.tablemodule'); tablemodule.each(function() { $(this).find('tr:first').addclass('trhead'); }); }; /* tab-switch-module createdate:2015/03/24 ģ���ǩ���л����� */ wsf.tabswitchmodule = function() { var tabswitch = $("div.tab-switch-module"), tabt = tabswitch.find("div.tab-switch-t"), tabc = tabswitch.find("div.tab-switch-c"); tabt.on({ click: function() { if(tabt.data('noswitch') != 1){ var that = $(this), indexs = that.index(); that.find("span").addclass("active"); that.siblings("li").find("span").removeclass("active"); tabc.find('.tab-c-item').each(function() { if ($(this).index() == indexs) { $(this).addclass("tab-c-item-active"); } else { $(this).removeclass("tab-c-item-active"); } }) } } }, "li"); }; // ���ɱ༭ģ�� wsf.customeditmodule = function(){ var customeditmodule = $('div.custom-edit-module').each(function(){ var t = $(this),tp = t.parent(); t.css({height : tp.height()}); }) }; /* row-classify-module createdate:2015/08/16 �����ʒ�����б�ģ��ķ��� */ wsf.classifymodule = function(){ $("div.classify-module").on({ mouseenter : function(){ $(this).addclass("classify-hover"); }, mouseleave : function(){ $(this).removeclass("classify-hover"); } },".big-classify,.small-classify"); }; /*ѡ���б�*/ wsf.selectstate = function(){ $("#filtersort").on({ mouseenter : function(){ $(this).addclass("select-state-hover"); }, mouseleave : function(){ $(this).removeclass('select-state-hover'); } },".select-state") }; // �ֶ��ƶ�ģ�� wsf.manualmovemodule = function(obj){ var manual; manual = obj ? obj : $("div.manual-move-module"); manual.each(function(){ var t = $(this), li = t.find('li'), linum = li.length, liw = li.outerwidth(), ulp = t.find(".pic-text-list-module"); ulp.width(liw * linum); }); manual.on({ click : function(){ var t = $(this), id = t.data('id'), obj = t.parent(); movefun(id,obj); } },'em.prev-move,em.next-move'); manual.on({ mouseenter : function(){ var t = $(this); t.find('em.prev-move,em.next-move').css('visibility','visible'); }, mouseleave : function(){ var t = $(this); t.find('em.prev-move,em.next-move').css('visibility','hidden'); } }); var movefun = function(dir,obj){ var curmanual = obj, list = curmanual.find('.manual-move-body'), ulp = curmanual.find(".pic-text-list-module"), li = ulp.find('li'), linum = li.length, liwidth = li.outerwidth(), shownum = math.floor((list.width()) / liwidth), ulpw = ulp.width(), ulpleft = math.abs(parseint(ulp.css('margin-left'))), move = shownum * liwidth, newmove = ulpw - (ulpleft + move), nowmove; if(curmanual.data('move') == 1) return false; curmanual.data('move',1); if(dir == 'next'){ if(newmove > 0 && newmove > move){ nowmove = move; }else{ nowmove = newmove; } if(ulpw > move){ ulp.animate({ "marginleft": "-=" + nowmove }, 500,function(){ curmanual.removedata('move'); }); } }else{ nowmove = ulpleft > move ? move : ulpleft; ulp.animate({ "marginleft": "+=" + nowmove }, 500,function(){ curmanual.removedata('move'); }); } }; }; /* //jquery focusimg //qwguo qwguo@sohu.com //copyright www.ev123.com // ����ͼjs���� */ (function($) { $.fn.extend({ focusimg: function(options) { return this.each(function() { var opts = { uistyle: "style-1", fnclass: "inout", evtype: "mouseenter", usertime: 6 }; opts = $.extend(opts, options); var full = $(this), fwidth = full.parent().width(), fheight = full.parent().height(), uistyle = opts.uistyle, fnclass = opts.fnclass, pul = full.children("ul"), pli = pul.find("li"), bnav = $("
"), times = null, an = true, y = 0, change = function(e) { //ͼƭ��ַ���� var curli = e, bigpic = curli.attr("bigpic"), bcolor = curli.attr("bcolor"); curli.css({ "background-color": bcolor, "background-image": "url(" + bigpic + ")" }); curli.attr("change", "true"); }, eventfn = function(obj, fobj) { //�¼�ģʽ obj.find(fobj).each(function(e) { $(this).bind(opts.evtype, function() { eval(fnclass + "(e)"); }); }); }; switch (opts.fnclass) { case 'inout': (function() { pul.addclass('banner-pic-1').css({ "height": fheight }); pli.each(function() { $(this).css({ "height": fheight }); }); })(); break; case 'lmove': (function() { full.css({ "height": fheight + "px" }); pul.addclass('banner-pic-2').css({ "width": pli.length * fwidth + "px", "height": fheight + "px" }); pli.each(function() { $(this).css({ "width": fwidth + "px", "height": fheight }); }); })(); break; case 'tmove': (function() { full.css({ "height": fheight + "px" }); pul.addclass('banner-pic-3').css({ "height": pli.length * fheight + "px" }); pli.each(function() { $(this).css({ "height": fheight }); }); })(); break; } switch (opts.uistyle) { case "style-1": if(pli.length > 1){ var ban = $("
"); pli.each(function(e) { ban.append(""); }) full.append(bnav.attr("class", "banner-nav-1").html(ban)); eventfn(ban, "span"); } break; case "style-2": if(pli.length > 1){ var ban = $("
"); pli.each(function(e) { ban.append("" + (e + 1) + ""); }) full.append(bnav.attr("class", "banner-nav-2").html(ban)); eventfn(ban, "span"); } break; case "style-3": var ban = $("
"); pli.each(function() { var smallurl = $(this).attr("smallpic") ? $(this).attr("smallpic") : $(this).attr("bigpic"); var s = $("").html(""); ban.append(s); }); full.append(bnav.attr("class", "banner-nav-3").html(ban)); eventfn(ban, "span"); break; } var inout = function(e) { var curli = pli.eq(e); if (curli.attr("change") == "false") { change(curli); } var ospan = bnav.find("span.cur"); var o = ospan.index(); if (e != o) { if (an) { an = false; ospan.removeclass("cur"); bnav.find("span:eq(" + e + ")").addclass("cur"); pli.eq(o).css({ "z-index": 3 }).animate({ "opacity": 0 }, 1000, function() { an = true; $(this).css({ "opacity": 1, "z-index": 1 }); }); curli.css({ "display": "block", "z-index": 2 }); y = y + 1 if (y >= pli.length) { y = 0; } } } }; var lmove = function(e) { var fullw = full.parent().width(), fullh = full.parent().height(); var curli = pli.eq(e); if (curli.attr("change") == "false") { change(curli); } var ospan = bnav.find("span.cur"); var o = ospan.index(); if (an) { an = false; ospan.removeclass("cur"); bnav.find("span:eq(" + e + ")").addclass("cur"); pul.animate({ "left": "-" + e * fullw }, 200, function() { an = true; y = y + 1 if (y >= pli.length) { y = 0; } }); } }; var tmove = function(e) { var fullh = full.height(); var curli = pli.eq(e); if (curli.attr("change") == "false") { change(curli); } var ospan = bnav.find("span.cur"); var o = ospan.index(); if (an) { an = false; ospan.removeclass("cur"); bnav.find("span:eq(" + e + ")").addclass("cur"); pul.animate({ "top": "-" + e * fullh }, 200, function() { an = true; y = y + 1 if (y >= pli.length) { y = 0; } }); } }; times = setinterval(function() { eval(opts.fnclass + "(y)"); }, (opts.usertime) * 1000); full.mouseenter(function() { clearinterval(times); }); full.mouseleave(function() { times = setinterval(function() { eval(opts.fnclass + "(y)"); }, (opts.usertime) * 1000); }); eval(opts.fnclass + "(y)"); }); } }); })(jquery); /* //ģ���ƶ����� ��ҫ����ק��ĵ�ģ�������ƶ�ч�� */ (function($) { $.fn.extend({ "movemodule": function(options) { return this.each(function() { var defaulto = { axis: "top", speed: "slow", type: "flow", hand: false }; var o = $.extend(defaulto, options); var speed = 100; if (o.type == "flow") { switch (o.speed) { case "slowly": speed = 150; break; case "slow": speed = 100; break; case "normal": speed = 60; break; case "quick": speed = 30; break; case "quickly": speed = 5; break; } } else if (o.type == "single") { switch (o.speed) { case "slowly": speed = 5000; break; case "slow": speed = 4000; break; case "normal": speed = 3000; break; case "quick": speed = 2000; break; case "quickly": speed = 1000; break; } } var _this = $(this), movepx = 0, times = null, thispar = $(this).parent(), thisparh = thispar.height(), thisparw = thispar.width(), firstchild = _this.children().first(); if (o.axis == "top" || o.axis == "bottom") { var thish = _this.height(); } else if (o.axis == "left" || o.axis == "right") { if(_this.hasclass('pic-text-list-module')){ _this.addclass('pic-text-list-module-movel'); if(_this.hasclass('pic-text-list-module-1')){ firstchild.find("li").width(thisparw); } var li_w = 0; firstchild.find("li").each(function(){ li_w+= $(this).outerwidth(); }) firstchild.width(li_w); } var thisw = firstchild.width(); _this.width(firstchild.width() * 2 + 10); } var clone = $(firstchild.clone()); //���� if (o.axis == "top") { movepx = 0; _this.append(clone); times = setinterval(movet, speed); _this.bind("mouseout", function() { times = setinterval(movet, speed); }); _this.bind("mouseover", function() { clearinterval(times); }); } //���� if (o.axis == "bottom") { movepx = -(thish + (thish - thisparh)); _this.css({ "margin-top": -thish }).append(clone); times = setinterval(moveb, speed); _this.bind("mouseout", function() { times = setinterval(moveb, speed); }); _this.bind("mouseover", function() { clearinterval(times); }); } //���� if (o.axis == "left") { movepx = 0; _this.css({ "margin-left": 0 }).append(clone); times = setinterval(movel, speed); _this.bind("mouseout", function() { times = setinterval(movel, speed); }); _this.bind("mouseover", function() { clearinterval(times); }); } //���� if (o.axis == "right") { movepx = -(thisw); _this.css({ "margin-left": movepx }).append(clone); times = setinterval(mover, speed); _this.bind("mouseout", function() { times = setinterval(mover, speed); }); _this.bind("mouseover", function() { clearinterval(times); }); } //���ƶ����� function moveb() { if (thish != firstchild.height()) { thish = firstchild.height(); } var mt = parseint(_this.css("margin-top")); var itemh = firstchild.children().outerheight(); if (o.type == "flow") { if (mt < 0) { _this.css("margin-top", movepx); movepx++; } else { movepx = -thish; _this.css("margin-top", movepx); } } else if (o.type == "single") { if (mt < 0) { _this.animate({ "margin-top": mt + itemh }, 500); } else { _this.css("margin-top", -thish); _this.animate({ "margin-top": -(thish - itemh) }, 500); } } } //���ƶ����� function movet() { if (thish != firstchild.height()) { thish = firstchild.height(); } var itemh = firstchild.children().outerheight(); var mt = math.abs(parseint(_this.css("margin-top"))); if (o.type == "single") { if (mt < thish) { _this.animate({ "margin-top": -(mt + itemh) }, 500); } else { _this.css("margin-top", 0); _this.animate({ "margin-top": -(itemh) }, 500); } } else if (o.type == "flow") { if (mt < thish) { _this.css("margin-top", -movepx); movepx++; } else { movepx = 0; _this.css("margin-top", -movepx); } } } //���ƶ� function movel() { if (thisparw != _this.parent().width()) { if (_this.hasclass("prolistmodule_1")) { thisparw = _this.parent().width(); firstchild.children().width(thisparw); clone.remove(); clone = $(firstchild.clone()); _this.css({ "margin-left": 0 }).append(clone); thisw = firstchild.width(); _this.width(firstchild.width() * 2); } } var itemw = firstchild.children().outerwidth(); var ml = math.abs(parseint(_this.css("margin-left"))); if (o.type == "single") { if (ml < thisw) { _this.animate({ "margin-left": -(ml + itemw) }, 500); } else { _this.css("margin-left", 0); _this.animate({ "margin-left": -(itemw) }, 500); } } else if (o.type == "flow") { if (ml < thisw) { _this.css("margin-left", -movepx); movepx++; } else { movepx = 0; _this.css("margin-left", -movepx); } } } //���ƶ� function mover() { if (thisparw != _this.parent().width()) { if (_this.hasclass("pic-text-list-module-1") || _this.hasclass("pic-text-list-module-2")) { thisparw = _this.parent().width(); firstchild.children().width(thisparw); clone.remove(); clone = $(firstchild.clone()); _this.css({ "margin-left": -firstchild.width() }).append(clone); thisw = firstchild.width(); _this.width(firstchild.width() * 2); } } var itemw = firstchild.children().outerwidth(); var ml = parseint(_this.css("margin-left")); if (o.type == "single") { if (ml < 0) { _this.animate({ "margin-left": ml + itemw }, 500); } else { _this.css("margin-left", -thisw); _this.animate({ "margin-left": -(thisw - itemw) }, 500); } } else if (o.type == "flow") { if (ml < 0) { _this.css("margin-left", movepx); movepx++; } else { movepx = -thisparw; _this.css("margin-left", movepx); } } } }); } }); })(jquery); /* //textlist module �ı��б�ǰ�꺯��,ϊҳ����ı��б����ǰ�� */ // $(function(){ // var icon_array = { // 'icon_1':"•", //'' // 'icon_2':"☆", //'��' // 'icon_3':"★", //'��' // 'icon_4':"○", //'��' // 'icon_5':"●", //'��' // 'icon_6':"◇", //'��' // 'icon_7':"◆", //'��' // 'icon_8':"□", //'��' // 'icon_9':"■", //'��' // 'icon_10':"△", //'��' // 'icon_11':"▲", //'��' // 'icon_12':"※" //'��' // } // var textlist_1 = $("div.text-list-module-1"), // textlist_2 = $("div.text-list-module-2"); // textlist_1.each(function(){ // $(this).find("li").each(function(){ // var codes = $(this).find("code"), // dataid = codes.data("id"); // if(dataid){ // codes.html(icon_array[dataid]); // } // }) // }); // }); // ��ʒ����ҳ��ͼƭч�� wsf.innerpreview = function(id) { var preview = $(id), bigpics = preview.find(".show-big-pic"), bigpic = bigpics.find(".pics"), smalllistarea = preview.find(".small-pic-list-area"), leftbut = smalllistarea.find(".left-but"), rightbut = smalllistarea.find(".right-but"), slist = smalllistarea.find(".small-pic-list"), listul = slist.find("ul"), li = listul.find("li"), ulw = 0, spic = "", zoom = ""; li.each(function() { ulw += $(this).width(); }); // listul.width(ulw); var movepx = 0, cmovepx = ulw - slist.width(); rightbut.on({ click: function() { if (movepx < cmovepx) { if (!listul.is(":animated")) { listul.animate({ marginleft: -(movepx += li.width()) }, 200); } } } }); leftbut.on({ click: function() { if (movepx > 0) { if (!listul.is(":animated")) { listul.animate({ marginleft: -(movepx -= li.width()) }, 200); } } } }); li.on({ click: function() { $(this).siblings().removeclass('licur').end().addclass("licur"); var msrc = $(this).find("img").attr("msrc"), bsrc = $(this).find("img").attr("bsrc"); bigpics.find("img").attr({ "src": msrc, "bsrc": bsrc }); } }); bigpics.on({ mouseenter: function(event) { var that = $(this), bsrc = that.find("img").attr("bsrc"); if (that.data("hover") != 1) { that.data("hover", 1); zoom = $('
'); that.children().append(zoom); spic = $('
'); spic.css({ "left": (preview.width() + 10) + "px", "top": "0px" }); spic.appendto(preview); } var l = event.clientx, t = event.clienty + $(document).scrolltop(); fun(l, t); }, mousemove: function(event) { var l = event.clientx, t = event.clienty + $(document).scrolltop(); fun(l, t); }, mouseleave: function() { var that = $(this); that.removedata("hover"); zoom.remove(); spic.remove(); zoom = ""; spic = ""; } }); var fun = function(l, t) { l = l - bigpic.offset().left - zoom.outerwidth() / 2; t = t - bigpic.offset().top - zoom.outerheight() / 2; if (l < 0) { l = 0; } else if (l > bigpic.outerwidth() - zoom.outerwidth()) { l = bigpic.outerwidth() - zoom.outerwidth(); } if (t < 0) { t = 0; } else if (t > bigpic.outerheight() - zoom.outerheight()) { t = bigpic.outerheight() - zoom.outerheight(); } zoom.css({ "left": l + "px", "top": t + "px" }); var lx = l / (bigpic.outerwidth() - zoom.outerwidth()), tx = t / (bigpic.outerheight() - zoom.outerheight()); var img = spic.children("img"); img.css({ "left": -lx * (img.outerwidth() - spic.outerwidth()) + "px", "top": -tx * (img.outerheight() - spic.outerheight()) + "px" }); } }; // ��ƹ���� function zpshowdiv() { var winwidth = $("body").width(), winheight = $("body").height(); $('#allzz').css({ display: "block", width: winwidth, height: winheight }); $("#zpalert").css({ display: "block" }); } function zpclosediv() { $("#allzz,#zpalert").css({ display: "none" }); } /**��ʒ����ҳ��ͼƭչʾч��**/ $(function() { var preview = $("#inner_preview"), bigpics = preview.children(".bigpics"), bigpic = bigpics.children(".bigpic"), smalllistarea = preview.children(".smallpic_listarea"), leftbut = smalllistarea.children(".left_but"), rightbut = smalllistarea.children(".right_but"), slist = smalllistarea.children(".smallpic_list"), listul = slist.children("ul") li = listul.children("li"), ulw = 0, spic = "", zoom = ""; li.each(function() { ulw += $(this).width(); }); listul.width(ulw); var movepx = 0, cmovepx = ulw - slist.width(); rightbut.on({ click: function() { if (movepx < cmovepx) { if (!listul.is(":animated")) { listul.animate({ marginleft: -(movepx += li.width()) }, 200); } } } }); leftbut.on({ click: function() { if (movepx > 0) { if (!listul.is(":animated")) { listul.animate({ marginleft: -(movepx -= li.width()) }, 200); } } } }); li.on({ click: function() { $(this).siblings().removeclass('pic_box_cur').end().addclass("pic_box_cur"); var msrc = $(this).children("img").attr("msrc"), bsrc = $(this).children("img").attr("bsrc"); bigpics.find("img").attr({ "src": msrc, "bsrc": bsrc }); } }); bigpics.on({ mouseenter: function(event) { var that = $(this), bsrc = that.find("img").attr("bsrc"); if (that.data("hover") != 1) { that.data("hover", 1); zoom = $('
'); that.children().append(zoom); spic = $('
'); spic.css({ "left": (preview.width() + 10) + "px", "top": "0px" }); spic.appendto(preview); } var l = event.clientx, t = event.clienty; fun(l, t); }, mousemove: function(event) { var l = event.clientx, t = event.clienty; fun(l, t); }, mouseleave: function() { var that = $(this); that.removedata("hover"); zoom.remove(); spic.remove(); zoom = ""; spic = ""; } }); var fun = function(l, t) { l = l - bigpic.offset().left - zoom.outerwidth() / 2; t = t - bigpic.offset().top - zoom.outerheight() / 2; if (l < 0) { l = 0; } else if (l > bigpic.outerwidth() - zoom.outerwidth()) { l = bigpic.outerwidth() - zoom.outerwidth(); } if (t < 0) { t = 0; } else if (t > bigpic.outerheight() - zoom.outerheight()) { t = bigpic.outerheight() - zoom.outerheight(); } zoom.css({ "left": l + "px", "top": t + "px" }); var lx = l / (bigpic.outerwidth() - zoom.outerwidth()), tx = t / (bigpic.outerheight() - zoom.outerheight()); var img = spic.children("img"); img.css({ "left": -lx * (img.outerwidth() - spic.outerwidth()) + "px", "top": -tx * (img.outerheight() - spic.outerheight()) + "px" }); } }); //�ֶ����ҹ�����ʒч���d�d�� wsf.flow_pro_ = function(n, t) { var contn = $(n).parent(), $list_ul = contn.find("ul"), $list_ul_par = $list_ul.parent(), $list_li_num = $list_ul.find("li").length, $list_li_lborder = parseint($list_ul.find("li").css("border-left-width")), $list_li_rborder = parseint($list_ul.find("li").css("border-right-width")), $list_li_lpadd = parseint($list_ul.find("li").css("padding-left")), $list_li_rpadd = parseint($list_ul.find("li").css("padding-left")), $list_li_rmargin = parseint($list_ul.find("li").css('margin-right')), $list_li_lmargin = parseint($list_ul.find("li").css('margin-left')); $list_li_lborder = isnan($list_li_lborder) ? 0 : $list_li_lborder; $list_li_rborder = isnan($list_li_rborder) ? 0 : $list_li_rborder; $list_li_rmargin = isnan($list_li_rmargin) ? 0 : $list_li_rmargin; $list_li_lmargin = isnan($list_li_lmargin) ? 0 : $list_li_lmargin; var $list_li_width = $list_ul.find("li").width() + $list_li_lborder + $list_li_rborder + $list_li_lmargin + $list_li_rmargin + $list_li_lpadd + $list_li_rpadd, $show_num = math.floor(($list_ul_par.width()) / $list_li_width), $ul_width = $list_li_width * $list_li_num, $list_ul_left = math.abs($list_ul.position().left), $page = math.ceil($list_li_num / $show_num), $move = $show_num * $list_li_width, $newmove = $ul_width - ($list_ul_left + $move); if (t == 1) { if ($newmove > 0) { if ($newmove > $move) { if ($list_ul.is(':animated') == false) { $list_ul.animate({ "left": "-=" + $move }, 500); $(n).parent().find(".left-but").addclass("left-but-off"); } } else { if ($list_ul.is(':animated') == false) { $list_ul.animate({ "left": "-=" + $newmove }, 500); $(n).parent().find(".right-but").addclass("right-but-off"); $(n).parent().find(".left-but").addclass("left-but-off"); } } } } else { if ($list_ul_left > 0) { if ($list_ul_left > $move) { if ($list_ul.is(':animated') == false) { $list_ul.stop().animate({ "left": "+=" + $move }, 500); $(n).parent().find(".right-but").removeclass("right-but-off"); } } else { if ($list_ul.is(':animated') == false) { $list_ul.stop().animate({ "left": "+=" + $list_ul_left }, 500); $(n).parent().find(".left-but").removeclass("left-but-off"); $(n).parent().find(".right-but").removeclass("right-but-off"); } } } } }; /*--�ֶ����ҹ�����ʒfunction--*/ wsf.flow_pro = function() { $(".right-but").click(function() { wsf.flow_pro_(this, 1); }); $(".left-but").click(function() { wsf.flow_pro_(this, 2); }); }; /*���߿ͷ�*/ wsf.onlineservice = function(){ var onservice_panel = $("#onservice_panel"); onservice_panel.on({ mouseenter : function(){ onservice_panel.animate({ right: 0 }); $(this).hide(); } },"#onlineopen"); onservice_panel.on({ click : function(){ onservice_panel.animate({ right: -102 }); onservice_panel.find(".online_tab").fadeout(100); onservice_panel.find("#onlineopen").show(); } },"#onlineclose"); $(".online_icon").click(function() { $(".online_tab").fadeout(100); var onclickid = $(this).attr("id"); var findparent_tab; switch (onclickid) { case "online_tel_icon": findparent_tab = $("#onlineteltab"); break; case "online_qq_icon": findparent_tab = $("#onlineqqtab"); break; case "online_message_icon": findparent_tab = $("#onlinemessagetab"); break; } findparent_tab.fadein(100); }); $("#onservice_panel .tab_close").click(function() { $(this).parents(".online_tab").hide(); }); function checklen(obj, maxs) { var maxchars = maxs; //����ַ��� if (obj.value.length > maxchars) { obj.value = obj.value.substring(0, maxchars); } var curr = maxchars - obj.value.length; $(obj).parents("dl").find(".text_length b").text(curr.tostring()); } }; /*��վ��ȼ���*/ wsf.loadwidth = function(){ var w = $(window),ww = w.width(),bodys = $('body'); if(ww < usersitewidth){ bodys.width(usersitewidth + 20); } }; /*ģ���������ִ��*/ if(!(/msie [6|7|8|9]/i.test(navigator.useragent))){ wsf.wow_ = function(){ wsf.wow = new wow({ boxclass: 'custommodule', animateclass: 'animated', offset: 0, mobile: true, live: true }); }; } /*ҳ��������ҫִ�м��صĺ���*/ $(function(){ wsf.nav(); wsf.focuspicmodule(); wsf.textlistmodule(); wsf.cataloglist(); wsf.menucatalogmodule(); wsf.tabswitchmodule(); // wsf.tablemodule(); wsf.tabswitchmodule(); wsf.classifymodule(); wsf.selectstate(); wsf.customeditmodule(); wsf.manualmovemodule(); if(!is_action){ wsf.loadwidth(); } });