function SeachBrand(n,t,i){$.post("/list/Partial_Brand?dcid="+n+"&zcid="+t+"&xcid="+i,function(n){$("#Searchbrand").html(n)})}function GetClass(n,t){$(t).empty(),$(t).parent().addClass("spanload"),$("").val(0).text("--请选择分类--").appendTo($(t)),$.getJSON("/JSONData/GetProductClass",{id:n},function(n){for(var r="",i=0;i"+n[i].CategoriesName+"";$(t).parent().removeClass("spanload"),$(t).append(r)})}function ClickSearch(){var n=$(".listLoad");n.html("载入中...
"),$.post("/list/searchlist",$("#frmList").serialize(),function(t){$("#productList").html(t),n.html(""),$("img.listImg").viewload();var i=$("#ItemCount").text();i==null?$("#productCount").text("0"):$("#productCount").text(i),$("#PageIndex").text($("#hidCurrentPage").val()),$("#PageCount").text($("#hidTotalPage").val()),$("#proname").text($("#ProductName").val())})}function Search(n){var t=$(".listLoad");t.html("载入中...
"),$.post($(n).attr("href"),$("#frmList").serialize(),function(n){$("#productList").html(n),t.html(""),$("img.listImg").viewload(),$("#PageIndex").text($("#hidCurrentPage").val())})}function pageSearch(n){var t=0,r=0,u,i;t=$("#hidCurrentPage").val(),r=$("#hidTotalPage").val(),t=n==1?t-1:parseInt(t)+1,t>0&&t<=r&&(u=$("#hidClassId").val(),i=$(".listLoad"),i.html("载入中...
"),$.post("/list/searchlist?idindex="+t,$("#frmList").serialize(),function(n){$("#productList").html(n),i.html(""),$("img.listImg").viewload(),$("#PageIndex").text($("#hidCurrentPage").val()),$("#PageCount").text($("#hidTotalPage").val())}))}var moveBrand=function(){var n=!1;GetClass(0,$("#ddlDClass")),$("#ddlDClass").delegate("","change",function(){$(this).val()=="0"?(n=!1,$("#ddlZClass :not(:first)").remove()):(GetClass($(this).val(),$("#ddlZClass")),$("#ddlXClass :not(:first)").remove()),SeachBrand($(this).val(),0,0)}),$("#ddlZClass").delegate("","change",function(){$(this).val()=="0"?(n=!1,$("#ddlXClass :not(:first)").remove()):GetClass($(this).val(),$("#ddlXClass")),SeachBrand($("#ddlDClass").val(),$(this).val(),0)}),$("#ddlXClass").delegate("","change",function(){SeachBrand($("#ddlDClass").val(),$("#ddlZClass").val(),$(this).val())}),$("#Searchbrand").delegate(".zmid","mouseenter",function(){var t=$(this),n=$(".brindbox"),i=t.attr("data-id");$("#selBrind a").removeClass("afb"),t.addClass("afb"),n.find(".brindlist").hide(),n.show(),$("#"+i).show()}),$(".seldiv").delegate("","mouseleave",function(){var i=$(this),t;n!=!1&&(t=$(".brindbox"),$("#selBrind a").removeClass("afb"),$("#selBrind a[data-id='"+n+"']").addClass("afb"),t.find(".brindlist").hide(),$("#"+n).show())}),$("#Searchbrand").delegate(".brindlist a","click",function(){$(".brindlist a").removeAttr("class"),$(this).addClass("abrand"),n=$(this).parent().parent().attr("id");var t=$(this).attr("data-brand");return $("#hidBrand").val(t),ClickSearch(),!1}),$("#Searchbrand").delegate(".selBrind a[data-id='close']","click",function(){return $(".brindbox").hide(),$("#selBrind a").removeClass("afb"),$(".brindlist a").removeAttr("class"),$("#hidBrand").val("0"),n=!1,ClickSearch(),!1})};moveBrand(),$("#selStar a").click(function(){$("#selStar a").removeAttr("class"),$(this).addClass("afocus");var n=$(this).attr("data-star");return $("#hidStar").val(n),ClickSearch(),!1}),$("#selPrice a").click(function(){$("#selPrice a").removeAttr("class"),$(this).addClass("afocus");var n=$(this).attr("data-price");return $("#hidPrice").val(n),ClickSearch(),!1}),$(".arrange a").click(function(){var t=$(this).attr("data-id"),n;return $(".arrange a").removeAttr("class"),$(this).addClass("list_"+t),n=$(this).attr("data-id"),$("#hidOrder").val(n),ClickSearch(),!1}),$(".ProductList").delegate(".listLi","mouseenter",function(){$(this).addClass("liHover")}),$(".ProductList").delegate(".listLi","mouseleave",function(){$(this).removeClass("liHover")}),function(n){n.fn.viewload=function(t){var i={_before:0,_moreimg:0,_event:"scroll",_show:"fadeIn",_object:window,_oimg:"/Content/images/blank.gif"},r;return t&&n.extend(i,t),r=this,i._event=="scroll"&&n(i._object).bind("scroll",function(){var f=0,u;r.each(function(){if(n.s_y(this,i)||n.s_x(this,i)){if(f++>i._moreimg)return!1}else n(this).trigger("loadImg")}),u=n.grep(r,function(n){return!n.loaded}),r=n(u)}),this.each(function(){var t=this;i._event!="scroll"||n.s_y(t,i)||n.s_x(t,i)?(n(t).attr("srcData",n(t).attr("src")),n(t).attr("src",i._oimg),n(t).css({background:"#fff url(/Content/images/load.gif) no-repeat center center"}),t.loaded=!1):t.loaded=!0;n(t).one("loadImg",function(){this.loaded||n("
").bind("load",function(){n(t).hide().attr("src",n(t).attr("srcData"))[i._show](i.effectspeed),t.loaded=!0}).attr("src",n(t).attr("srcData"))});i._event!="scroll"&&n(t).bind(i._event,function(){t.loaded||n(t).trigger("loadImg")})})},n.s_y=function(t,i){var r;return r=i._object===undefined||i._object===window?n(window).height()+n(window).scrollTop():n(i._object).offset().top+n(i._object).height(),r<=n(t).offset().top-i._before},n.s_x=function(t,i){var r;return r=i._object===undefined||i._object===window?n(window).width()+n(window).scrollLeft():n(i._object).offset().left+n(i._object).width(),r<=n(t).offset().left-i._before},n.extend(n.expr[":"],{"below-the-fold":"$.s_y(a,{_before:0,_object:window})","above-the-fold":"!$.s_y(a,{_before:0,_object:window})","right-of-fold":"$.s_x(a,{_before:0,_object:window})","left-of-fold":"!$.s_x(a,{_before:0,_object:window})"})}(jQuery)