/*棣栭〉js浠g爜鏁村悎*/ //layout椤甸潰js鏁寸悊 鐧惧害鍟嗘ˉjs //鍟嗗鐑攢閫夐」鍗¤疆鎾璲s function homechange(d) { var j = (typeof d.area == "undefined") ? jQuery("") : d.area; var c = (typeof d.box == "undefined") ? jQuery("") : d.box; var b = (typeof d.btn == "undefined") ? jQuery("") : d.btn; var i = (typeof d.waitTime == "undefined") ? 8000: d.waitTime; var g = (typeof d.fadeTime == "undefined") ? "slow": d.fadeTime; var e = (typeof d.autoPlay == "undefined") ? true: d.autoPlay; var a = c.find(".index_goods_list ").length; c.find(".index_goods_list ").hide(); c.find(".index_goods_list:first").addClass("selected").show(); b.find("span:first a").addClass("selected"); if (a <= 1) { b.hide(); e = false } function l(k) { b.find("span a").removeClass("selected"); b.find("span a").eq(k).addClass("selected"); c.find(".index_goods_list").removeClass("selected"); c.find(".index_goods_list").eq(k).addClass("selected"); c.find(".index_goods_list").hide(); c.find(".index_goods_list.selected").show(); $(".index_goods_list").eq(k).find("img").each(function(i){ if(this.src==''){ this.src=$(this).attr('data-original'); $(this).attr("class","lazy"); } }); } b.find("span").hover(function() { var k = jQuery(this).index(); l(k) }); function f() { var k = c.find(".index_goods_list.selected").index(); if (k == a - 1) { k = -1 } k = k + 1; l(k) } if (e) { var h = setInterval(f, i); j.hover(function() { clearInterval(h) }, function() { h = setInterval(f, i) }) } } $(function () { var count=$(".index_content_goods").size(); for(var i=1;i<=count;i++){ homechange({ area : $(".index_content_goods:nth-child("+i+")"), //榧犳爣缁忚繃鍋滄鑷姩鎾斁鐨勫尯鍩 box : $(".index_content_goods::nth-child("+i+") .index_content_con"), //鍖呭惈椤圭洰鐨勫鍣 btn : $(".index_content_goods::nth-child("+i+") .ct_hy"), //鍖呭惈鐒︾偣鎸夐挳鐨勫鍣 waitTime : 5000, //鍒囨崲闂撮殧鏃堕棿 fadeTime : 500, //娣″叆娣″嚭鏃堕棿 autoPlay : true //鏄惁鑷姩鎾斁 }); } }) //澶撮儴鎼滅储閫夐」鍒囨崲 $(function() { $(".search_head ul li").click(function(){ var i=$(this).index(); $(this).addClass('selected').siblings().removeClass('selected'); var key_tj = $(this).attr('key_tj'); if(key_tj!=undefined&&key_tj!=''){ $('#center2_text').attr('placeholder',key_tj); } searchType=$(this).attr("val"); action="/Search/"+searchType; $("#searchform").attr("action",action); }) //搴曢儴鍙嬫儏閾炬帴 $(".footer_link").click(function() { if($(".index_net_link").is(":hidden")==true){ $(this).addClass("link_tb"); }else{ $(this).removeClass("link_tb"); } $(".index_net_link").slideToggle(); }); }); //妤煎眰閫夋嫨 $(function(){ for(var i=1;i<=2;i++){ $('.tools_tb'+i).click(function () { $('html, body').animate({ scrollTop: $($.attr(this, 'lang')).offset().top }, 500); }); } }) $(document).ready(function(){ function scrolls(){ var top = Math.max($("html").scrollTop(), $("body").scrollTop()); var scrollheight=$(".menu_line").offset().top; if(top>scrollheight){ $(".home_tools_r").show(); }else{ $(".home_tools_r").hide(); } } $(window).scroll(scrolls); scrolls(); }) if($(".nav").length>0){ var navH = $(".nav").offset().top; //婊氬姩鏉′簨浠 $(window).scroll(function(){ //鑾峰彇婊氬姩鏉$殑婊戝姩璺濈 var scroH = $(this).scrollTop(); //婊氬姩鏉$殑婊戝姩璺濈澶т簬绛変簬瀹氫綅鍏冪礌璺濈娴忚鍣ㄩ《閮ㄧ殑璺濈锛屽氨鍥哄畾锛屽弽涔嬪氨涓嶅浐瀹 if(scroH>=navH){ $(".nav").css({"position":"fixed","top":0,"z-index":"9999"}); }else if(scroHul li").one('mouseover',function(){ var id = $(this).attr('id'); var right = $('#'+id+' .sort_f'); var url ="/Index/ajax_secate.html"; $.ajax({ url:url, type:'post', data:"id="+id, dataType:'json', success:function(json){ if (json=='false') {return false;}; right.after(json); } }); }); }); /*鎼滅储椤甸潰js鏁村悎*/ /********鍟嗗搧淇冮攢寮傛鍔犺浇鍐呭start***********/ var salesUrl = $("#salesUrl").val(); if(typeof(salesUrl)!='undefined'){ $(window).scroll(function(){ if($(window).scrollTop()+482 >= $(document).height() - $(window).height()){ lists(); } }); var num = 1; function lists(){ if(num > 1){ return false; } var url = salesUrl+"?num="+num; $.post(url,function(html){ $("#append_list").append(html); }); num = num+1; } } /************鍟嗗搧淇冮攢寮傛鍔犺浇鍐呭end***************/