// javascript document // javascript document if(!artron){ var artron = {}; } artron.imgverticaltoggle = function(element){ var $self = $(element), index = 1, num = $self.children().length, interval, intervalfunc = function(){ $self.children(":eq("+((index-1)%num)+")").fadeout(1000); $self.children(":eq("+(index%num)+")").fadein(1000,function(){ index++; }); }; interval = setinterval(intervalfunc,2500); $self.hover(function(){ clearinterval(interval); },function(){ interval = setinterval(intervalfunc,2500); }); } $(function(){ $(".leftlabel > li").bind("click",function(event){ event.stoppropagation(); var index = $(this).index(), tabsconele = $(".rightlist > .tabscon:eq("+index+")"); $(this).addclass("curr").siblings().removeclass("curr"); tabsconele.show().siblings().hide(); tabsconele.find(".zoom").children(".out").addclass("able").siblings().removeclass("able"); tabsconele.find(".text1").children().css("font-size",""); tabsconele.find(".nav1").datecontrol(); }).children("a").bind("click",function(event){ event.preventdefault(); }); $(".rightlist > .tabscon:eq(0)").find(".nav1").datecontrol(); $(".zoom1 > b").bind("click",function(){ $(this).addclass("able").siblings().removeclass("able"); if($(this).hasclass("in")){ $(".cont").children().css("font-size","") }else if($(this).hasclass("out")){ $(".cont").children().css("font-size","16px") } }) $(".zoom > b").bind("click",function(){ $(this).addclass("able").siblings().removeclass("able"); if($(this).hasclass("in")){ $(".text4").children().css("font-size","") }else if($(this).hasclass("out")){ $(".text4").children().css("font-size","14px") } }) $(".auction-nav li a").bind("click",function(event){ event.preventdefault(); }); $(".auction-preview .product li:eq(1)").find(".preimg img").css("vertical-align","top"); $(".zoom > b").hover(function(){ if($(this).hasclass("able")){ $(this).stop().animate({ "background-color" : "#003399" },500); } },function(){ if($(this).hasclass("able")){ $(this).stop().css({ "background-color" : "#999999" }); } else { $(this).stop().css({ "background-color" : "" }); } }).bind("click",function(){ var $detailobj =$(this).closest(".tabscon").children(".text1").children(), currentsize = parsefloat($detailobj.css("font-size")); if($(this).hasclass("able")){ if($(this).hasclass("in")){ currentsize-=2; } else { currentsize+=2; } $(this).removeclass("able").css("background-color", "").siblings().addclass("able"); $detailobj.css("font-size",currentsize + "px"); } }); /*tab页签切换*/ jquery.tabsalt=function(){ $(this).addclass("current").siblings().removeclass("current"); var tabsindex=parseint($(this).index()); var $condiv=$(this).closest(".tabs"); $condiv.children(".tabscont").eq(tabsindex).show().siblings(".tabscont").hide(); return false; } $("ul.tabstag li").click($.tabsalt); /** 拍卖结果 */ $("#leftdatesearch > div").bind("click",function(event){ event.stopimmediatepropagation(); $(this).children(".ds_list").slidetoggle(199); $(this).siblings().children(".ds_list").slideup(199); }).children(".ds_list").find("li").bind("click",function(){ var yeardata = $(this).html(); $(this).closest("div").siblings(".sinput").val(yeardata); $(this).closest("div").siblings(".ds_title").html(yeardata); //document.getelementbyid("leftdatesearch").submit(); }); $("#leftdatesearch > .set > .sinput").bind("focus",function(){ if("输入搜索关键字" == $(this).val()){ $(this).val(""); } }).bind("blur",function(){ if(!$(this).val()){ $(this).val("输入搜索关键字"); } }); $("#leftdatesearch > .set").find("a").bind("click",function(event){ event.preventdefault(); document.getelementbyid("leftdatesearch").submit(); }); $(document).bind("click",function(){ $(".ds_list:visible").slideup(199); }); }) $.fn.datecontrol = function(){ var self = this, dateele = $(self).children("ul"), datewidth = dateele.children("li").outerwidth(true), datelength = dateele.children("li").length; dateele.css("width", (datelength + 2)*datewidth + 10 + "px"); dateele.children("li").bind("click",function(event){ event.stoppropagation(); if($(this).hasclass("curr")){ return; } /** 异步请求 */ /*var year = $(this).children("a").html(); $.ajax({ "type" : "post", "url" : "", "data" : { "year" : year }, "success" : function(data){ if(data){ $(".auction-results").html(data); } } });*/ $(this).addclass("curr").stop().css("width", "88px").animate({ "width" : "280px" },299); $(this).siblings(".curr").stop().animate({ "width" : "88px" },299,function(){ $(this).removeclass("curr"); $(this).css("width", ""); }); }).children("a").bind("click",function(event){ event.preventdefault(); }); dateele.find(".calendar").find("li").bind("click",function(event){ event.stoppropagation(); $(this).addclass("curr").siblings("li").removeclass("curr"); var year = $(this).closest(".calendar").siblings("a").html(), month = $(this).children("a").html(); /*$.ajax({ "type" : "post", "url" : "", "data" : { "year" : year, "month" : month }, "success" : function(data){ if(data){ $(".auction-results").html(data); } } });*/ }).children("a").bind("click",function(event){ event.preventdefault(); }); var initcontrolleft, initleft, totalwidth = $(".table-scroll").outerwidth(), bigouterwidth = $(self).parent().outerwidth(), scrollerwidth = $(".table-scroll > span").outerwidth(); $(".table-scroll > span").bind("mousedown",function(event){ initcontrolleft = parsefloat($(this).css("left")); initleft = event.pagex || event.clientx; $(document).bind('selectstart', function() { return false; }); $("body").css("-moz-user-select",'-moz-none'); }); $(document).bind("mousemove",function(event){ if(typeof initleft == "number"){ var x = event.pagex || event.clientx, change = x - initleft; if(initcontrolleft + change >= 0 && initcontrolleft + change <= totalwidth - scrollerwidth){ $(".table-scroll > span").css("left", initcontrolleft + change + "px"); dateele.css("marginleft", (-1)*(initcontrolleft + change)*((((datelength + 2)*datewidth + 10) - bigouterwidth)/(totalwidth - scrollerwidth)) + "px"); } } }).bind("mouseup",function(){ if(typeof initleft == "number"){ initcontrolleft = null; initleft = null; $(document).unbind('selectstart'); $("body").css("-moz-user-select",''); } }); };