// javascript document function htmlsize(){ var ww; var maxw=640; var minw=320; if($(window).width()>maxw){ww=maxw;} else if($(window).width()100){$(".gotop").fadein();} else{$(".gotop").fadeout();} }); settimeout(function(){ if($("body").height()<$(window).height()){ $(".footer").addclass("footer_b"); } },100); $(window).resize(function(){ if($("body").height()<$(window).height()){ $(".footer").addclass("footer_b"); } else{ $(".footer").removeclass("footer_b"); } }) //pc search $(".header .tools .sc").click(function(event){ event.stoppropagation(); $(".header .search").toggleclass("s"); $(".header .search .kw").focus(); }); $(".header .search").click(function(event){ event.stoppropagation(); }); $(".header .search").mouseleave(function(){ $(".header .search").removeclass("s"); $(".header .search .kw").blur(); }); $(window).click(function(){ $(".header .search").removeclass("s"); $(".header .search .kw").blur(); }); //phone menu nav $(".menu").bind("click",function(event){ $(this).toggleclass("act"); $(".nav_main_m").toggleclass("show"); }); $(".nav_main_m .item i").bind("click",function(){ $(this).toggleclass("on"); $(this).parent().siblings().find("ul").slideup(300); $(this).siblings("ul").slidetoggle(300); }); $(".scmbtn").bind("click",function(event){ $(this).hide(); $(".search_m").addclass("s"); }); $(window).bind("touchend",function(){ $(".menu").removeclass("act"); $(".nav_main_m").removeclass("show"); $(".search_m").removeclass("s"); $(".scmbtn").show(); }); $(".search_m,.menu,.nav_main_m .nav,.nav_main_m .btns a").bind("touchend",function(event){ event.stoppropagation(); }); $(".nav_main_m").bind("touchmove",function(event){ event.stoppropagation(); }); //select $(".select").each(function(index, element) { var t=$(this); if(t.find(".txt").attr("placeholder")){ t.find(".txt").text(t.find("span").attr("placeholder")).addclass("pldr"); } t.click(function(){ $(this).find("ul").show(); t.css("z-index",1); }); /*if(!t.find("ul").hasclass("mcustomscrollbar")){ t.find("ul").mcustomscrollbar({scrollinertia:250}); }*/ t.mouseleave(function(){ $(this).find("ul").hide(); t.css("z-index",0); }); t.find("li").click(function(event){ event.stoppropagation(); t.find("span").text($(this).text()).removeclass("pldr"); t.find("input").val($(this).attr("value")); t.find("ul").hide(); t.css("z-index",0); }); }); //end }); /*$(".nav_main .item").hover( function(){ $(".nav_child .item").hide(); if($(".nav_child .item").eq($(this).index()).find("a").size()>0){ $(".nav_child .item").eq($(this).index()).show().addclass("s"); $(".nav_bg").stop(true,true).slidedown(); $(this).addclass("cur"); } else{ $(this).removeclass("cur"); } }, function(){ $(".nav_bg").stop(true,true).slideup(); $(this).removeclass("cur"); } ); $(".nav_child .item").hover( function(){ //$(".nav_child").find("s") $(".nav_bg").stop(true,true).show(); }, function(){ $(".nav_bg").stop(true,true).slideup(); $(".nav_main a").removeclass("cur"); $(this).hide(); } );*/