function mBrend(){if($("#mBrend a[data-brand]").length<=5)return $(".selMore a").css("color","#c2c2c2"),!1}function ClickSearch(){var t=$("#hidClassId").val(),n=$(".listLoad");n.html("
载入中...
"),$.post("/list/productlist?id="+t,$("#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())})}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/productlist?id="+u+"&idindex="+t,$("#frmList").serialize(),function(n){$("#productList").html(n),i.html(""),$("img.listImg").viewload(),$("#PageIndex").text($("#hidCurrentPage").val()),$("#PageCount").text($("#hidTotalPage").val())}))}$("#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}),$("#mBrend a").click(function(){$("#mBrend a").removeAttr("class"),$(this).addClass("afocus");var n=$(this).attr("data-brand");return $("#hidBrand").val(n),ClickSearch(),!1}),mBrend(),$(".selMore").click(function(){var n=$(this),t=n.attr("data-id")||"true";if(mBrend()!=!1)return t=="true"?(n.find("a").text("隐藏更多品牌>"),n.attr("data-id","false"),$("#mBrend").addClass("openBrend")):(n.removeAttr("data-id"),$("#mBrend").removeClass("openBrend"),n.find("a").text("显示更多品牌>")),!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)