/** * jquery jslides 1.1.0 * * http://www.cactussoft.cn * * copyright (c) 2009 - 2013 jerry * * dual licensed under the mit and gpl licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ $(function(){ var numpic = $('#slides li').size()-1; var nownow = 0; var inout = 0; var tt = 0; var speed = 5000; $('#slides li').eq(0).siblings('li').css({'display':'none'}); // load the images $('#slides .hdhe-lazyslide').each(function(){ $(this).css({ 'background-image': 'url(' + $(this).attr('data-bg') + ')' }) }); var ulstart = ''; addli(); var pagination = $('#pagination li'); var paginationwidth = $('#pagination').width(); $('#pagination').css('margin-left',(470-paginationwidth)) pagination.eq(0).addclass('current') function addli(){ //var lilicount = numpic + 1; for(var i = 0; i <= numpic; i++){ ulcontent += '
  • ' + '' + (i+1) + '' + '
  • '; } $('#slides').after(ulstart + ulcontent + ulend); } pagination.on('click',dotchange) function dotchange(){ var changenow = $(this).index(); $('#slides li').eq(nownow).css('z-index','900'); $('#slides li').eq(changenow).css({'z-index':'800'}).show(); pagination.eq(changenow).addclass('current').siblings('li').removeclass('current'); $('#slides li').eq(nownow).fadeout(400,function(){$('#slides li').eq(changenow).fadein(500);}); nownow = changenow; } pagination.mouseenter(function(){ inout = 1; }) pagination.mouseleave(function(){ inout = 0; }) function gogo(){ var nn = nownow+1; if( inout == 1 ){ } else { if(nownow < numpic){ $('#slides li').eq(nownow).css('z-index','900'); $('#slides li').eq(nn).css({'z-index':'800'}).show(); pagination.eq(nn).addclass('current').siblings('li').removeclass('current'); $('#slides li').eq(nownow).fadeout(400,function(){$('#slides li').eq(nn).fadein(500);}); nownow += 1; }else{ nn = 0; $('#slides li').eq(nownow).css('z-index','900'); $('#slides li').eq(nn).stop(true,true).css({'z-index':'800'}).show(); $('#slides li').eq(nownow).fadeout(400,function(){$('#slides li').eq(0).fadein(500);}); pagination.eq(nn).addclass('current').siblings('li').removeclass('current'); nownow=0; } } tt = settimeout(gogo, speed); } tt = settimeout(gogo, speed); }); // ---------------- (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,top:document.documentelement.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($){$.widthforie6=function(option){var s=$.extend({max:null,min:null,padding:0},option||{});var init=function(){var w=$(document.body);if($.browser.client().width>=s.max+s.padding){w.width(s.max+"px");}else if($.browser.client().width<=s.min+s.padding){w.width(s.min+"px");}else{w.width("auto");}};init();$(window).resize(init);}})(jquery);(function($){$.fn.hoverforie6=function(option){var s=$.extend({current:"hover",delay:10},option||{});$.each(this,function(){var timer1=null,timer2=null,flag=false;$(this).bind("mouseover",function(){if (flag){cleartimeout(timer2);}else{var _this=$(this);timer1=settimeout(function(){_this.addclass(s.current);flag=true;},s.delay);}}).bind("mouseout",function(){if (flag){var _this=$(this);timer2=settimeout(function(){_this.removeclass(s.current);flag=false;},s.delay);}else{cleartimeout(timer1);}})})}})(jquery);(function($){$.extend({_jsonp:{scripts:{},counter:1,head:document.getelementsbytagname("head")[0],name:function(callback){var name='_jsonp_'+(new date).gettime()+'_'+this.counter;this.counter++;var cb=function(json){eval('delete '+name);callback(json);$._jsonp.head.removechild($._jsonp.scripts[name]);delete $._jsonp.scripts[name];};eval(name+' = cb');return name;},load:function(url,name){var script=document.createelement('script');script.type='text/javascript';script.charset=this.charset;script.src=url;this.head.appendchild(script);this.scripts[name]=script;}},getjsonp:function(url,callback){var name=$._jsonp.name(callback);var url=url.replace(/{callback};/,name);$._jsonp.load(url,name);return this;}});})(jquery);(function($){$.fn.jdtab=function(option,callback){if(typeof option=="function"){callback=option;option={};};var s=$.extend({type:"static",auto:false,source:"data",event:"mouseover",currclass:"curr",tab:".tab",content:".tabcon",itemtag:"li",stay:5000,delay:100,maintimer:null,subtimer:null,index:0},option||{});var tabitem=$(this).find(s.tab).eq(0).find(s.itemtag),contentitem=$(this).find(s.content);if(tabitem.length!=contentitem.length)return false;var reg=s.source.tolowercase().match(/http:\/\/|\d|\.aspx|\.ascx|\.asp|\.php|\.html\.htm|.shtml|.js|\w/g);var init=function(n,tag){s.subtimer=settimeout(function(){hide();if(tag){s.index++;if(s.index==tabitem.length)s.index=0;}else{s.index=n;};s.type=(tabitem.eq(s.index).attr(s.source)!=null)?"dynamic":"static";show();},s.delay);};var autoswitch=function(){s.maintimer=setinterval(function(){init(s.index,true);},s.stay);};var show=function(){tabitem.eq(s.index).addclass(s.currclass);switch(s.type){default:case "static":var source="";break;case "dynamic":var source=(reg==null)?tabitem.eq(s.index).attr(s.source):s.source;tabitem.eq(s.index).removeattr(s.source);break;};if(callback){callback(source,contentitem.eq(s.index),s.index);};contentitem.eq(s.index).show();};var hide=function(){tabitem.eq(s.index).removeclass(s.currclass);contentitem.eq(s.index).hide();};tabitem.each(function(n){$(this).bind(s.event,function(){cleartimeout(s.subtimer);clearinterval(s.maintimer);init(n,false);return false;}).bind("mouseleave",function(){if(s.auto){autoswitch();}else{return;}})});if(s.type=="dynamic"){init(s.index,false);};if(s.auto){autoswitch();}}})(jquery);(function($){$.fn.jdslide=function(option){var settings=$.extend({width:null,height:null,pics:[],index:0,type:"num",current:"curr",delay1:200,delay2:8000},option||{});var element=this;var timer1,timer2,timer3,flag=true;var total=settings.pics.length;var init=function(){var img="";element.css({"position":"relative"}).html(img);$(function(){delayload();})};init();var initindex=function(){var indexs="
    ";var current;var x;for(var i=0;i";default:break;};indexs+=""+x+"";};indexs+="
    ";element.append(indexs);element.find("span").bind("mouseover",function(e){clearinterval(timer1);clearinterval(timer3);var index=element.find("span").index(this);if(index==settings.index){return;}else{timer3=setinterval(function(){if(flag)running(parseint(index));},settings.delay1);}}).bind("mouseleave",function(e){clearinterval(timer3);timer1=setinterval(function(){running(settings.index+1,true);},settings.delay2);})};var running=function(index,tag){if(index==total){index=0;};element.find("span").eq(settings.index).removeclass(settings.current);element.find("span").eq(index).addclass(settings.current);timer2=setinterval(function(){var pos_y=parseint(element.find("ul").get(0).style.top);var pos_a=math.abs(pos_y+settings.index*settings.height);var pos_b=math.abs(index-settings.index)*settings.height;var pos_c=math.ceil((pos_b-pos_a)/4);if(pos_a==pos_b){clearinterval(timer2);if(tag){settings.index++;if(settings.index==total){settings.index=0;}}else{settings.index=index;};flag=true;}else{if(settings.index";};element.find("ul").append(img);timer1=setinterval(function(){running(settings.index+1,true);},settings.delay2);if(settings.type)initindex();};}})(jquery);function resumeerror(){return true;}window.onerror=resumeerror;if($.browser.isie6){try{document.execcommand("backgroundimagecache",false,true);}catch(err){}};var calluri="http://fairyservice.360buy.com/webservice.asmx/markex?callback=?";var loguri="http://csc.360buy.com/log.ashx?type1=$type1$&type2=$type2$&data=$data$&callback=?";callback1=function(data){;};log=function(type1,type2,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10){var data='';for(i=2;i';};var gi_normal__=new object();gi_normal__.deliver=function(arg){if(arg.gi_automatchscreen&&screen.width>=1280){arg.gi_width=arg.gi_width_w;};var ad="";if(arg.gi_isautomonitorclick){ad='
    ';};if(arg.gi_type=="img"){ad+="";}else if(arg.gi_type=="flash"){ad+='';};var gi_k=gi_ga(arg.gi_ldp,"k");var gi_p=gi_ga(arg.gi_ldp,"p");document.getelementbyid("miaozhen"+arg.gi_pid).innerhtml+=ad+gi_get_monitor_code(gi_k,gi_p);};gi_focus__=new object();gi_focus__.next=function(){var arg=gi_focus__.arg;if(arg.gi_automatchscreen&&screen.width>=1280){arg.gi_width=arg.gi_width_w;};var ad_arr=arg.gi_ad_arr;gi_focus__.now%=ad_arr.length;var html='
    ';var i;var ad='';if(ad_arr[gi_focus__.now].gi_type=="img"){var ad='';}else if(ad_arr[gi_focus__.now].gi_type=="flash"){var ad='';};html=html+ad;for(i=0;i'+(i+1)+'
    ';}else{html+='
    '+(i+1)+'
    ';}};html+='';document.getelementbyid("miaozhen"+arg.gi_pid).innerhtml=html;gi_focus__.now++;};gi_focus__.deliver=function(arg){gi_focus__.arg=arg;var ad_arr=arg.gi_ad_arr;var newelement=document.createelement("div");newelement.innerhtml=gi_get_monitor_code(gi_ga(ad_arr[0].gi_ldp,"k"),gi_ga(ad_arr[0].gi_ldp,"p"));document.getelementbyid("miaozhen"+arg.gi_pid).parentnode.appendchild(newelement);gi_focus__.now=0;gi_focus__.timer=setinterval(gi_focus__.next,arg.gi_interval);gi_focus__.next();};var gi_rotate__=new object();gi_rotate__.deliver=function(arg){var ad_arr=arg.gi_ad_arr;var i=ad_arr[0][math.floor(math.random()*ad_arr[0].l)];if(arg.gi_automatchscreen&&screen.width>=1280){arg.gi_width=arg.gi_width_w;};var click='
    ';if(ad_arr[i].gi_type=="img"){var ad='';}else if(ad_arr[i].gi_type=="flash"){var ad='';};ad=click+ad;var gi_k=gi_ga(ad_arr[i].gi_ldp,"k");var gi_p=gi_ga(ad_arr[i].gi_ldp,"p");document.getelementbyid("miaozhen"+arg.gi_pid).innerhtml+=ad+gi_get_monitor_code(gi_k,gi_p);;}; var initscrolly=0; var proids=new array(); function compare(){ if($("#compare").get(0)==null){ $("body").append("
    ��ʒ�ƚ�
      "); $("#compare").css({position:"absolute",top:"220px",right:"0px"}); iscoo();} if($.browser.msie){ var defaulty=document.documentelement.scrolltop; var perceh=0.3*(defaulty-initscrolly); if(perceh>0){perceh=math.ceil(perceh);} else{perceh=math.floor(perceh);} $("#compare").get(0).style.top=parseint($("#compare").get(0).style.top)+perceh+"px"; initscrolly=initscrolly+perceh; settimeout("compare()",50)}else{ window.onscroll=function(){ $("#compare").get(0).style.top=parseint($("#compare").get(0).style.top)+"px"; $("#compare").get(0).style.position="fixed";}}} function clearcompare(){ $("#comprolist").empty(); $("#compare").hide(); createcookie("compare",""); proids=new array();} function addtocompare(checkobj,checkid,checkproname){ $("#compare").show(); $(".compro").show(); var proidstemp=proids.join("."); if(proidstemp.indexof(checkid)==-1){ if(proids.length<3){ proids.push(checkid); $("#comprolist").append("
    • "+checkproname+"
    • "); writecompare(checkid,checkproname);}else{ alert("�բ���������ѡ��������ʒ���жաȣ�");}}else{ alert("�բ������ѿ�ѡ�����ʒ��"); return;}} function reducecompare(checkid){ $("#check_"+checkid).remove(); $.each(proids,function(i,n){ if(checkid==n){ proids.splice(i,1);}}); var coo=readcookie("compare"); var idindexstart=coo.indexof(checkid); var idindexend=coo.indexof("|||",idindexstart)+3; var delstr=coo.substring(idindexstart,idindexend); var innerstr=coo.replace(delstr,"") createcookie("compare",innerstr); if(proids.length==0){$(".compro").hide();}} function opencompare(){ switch(proids.length){ case 1: alert("�բ�������ѡ��������ʒ���жաȣ�"); break; case 2: window.open("http://www.360buy.com/pcompare.aspx?s1="+proids[0]+"&s2="+proids[1]); break; case 3: window.open("http://www.360buy.com/pcompare.aspx?s1="+proids[0]+"&s2="+proids[1]+"&s3="+proids[2]); break; default: alert("��ѡ��2-3����ʒ���жաȣ�"); return;}} function writecompare(checkid,checkproname){ var comparelist=readcookie("compare"); if(comparelist==null){comparelist="";} comparelist+=checkid+"||"+escape(checkproname)+"|||"; createcookie("compare",comparelist);} function iscoo(){ var coo=readcookie("compare"); if(coo){ var cootemp=coo.split("|||"); var comparelisttemp=""; for(var i=0;i"+unescape(cootemp[i].split("||")[1])+""; proids.push(cootemp[i].split("||")[0]);} $("#comprolist").html(comparelisttemp); $("#compare").show(); $(".compro").show();}} function createcookie(name,value,days,tdom){ var tdom=(tdom)?tdom:"/"; if(days){ var date=new date(); date.settime(date.gettime()+(days*24*60*60*1000)); var expires="; expires="+date.togmtstring();}else{ var expires="";} document.cookie=name+"="+value+expires+"; path="+tdom;} function readcookie(name){ var nameeq=name+"="; var ca=document.cookie.split(';'); for(var i=0;i 0) }; jquery.fn.ischildof = function(a) { return (this.parents(a).length > 0) } });