$(function(){
?????//獲取瀏覽器寬度
?????var?_width?=?$(window).width();?
?????if(_width?<?1024){
????????????$(".hide-nav").hide();
????????????$(".undefined02").hide();
????????????$(".undefined01").hide();
????????????$(".flay1").removeClass("flay1").addClass("flay2");
????????????$(".carousel-control-gps").hide();
????????????$(".hui-reminder").removeClass("hui-reminder").addClass("hui-reminder-phone");
// ????????????$(".hide-foot").hide();
????????????$(".usernow-label").removeClass("usernow-label").addClass("usernow-label-phone");
????????????$(".usernow-major").removeClass("usernow-major").addClass("usernow-major-phone");
????????????$(".usernow-label-2").removeClass("usernow-label-2").addClass("usernow-label-2-phone");
????????????$(".product-function").removeClass("product-function").addClass("product-function-phone");
????????????$(".btn-column").hide();
????????????$(".num").css({"margin-left":"0px","text-align":"center"});
????????????$(".num?li").css("margin-right","5px");
????????????$(".navbar-default?.navbar-nav?li").css("margin-right","0px");
????????????$(".navbar-default?.navbar-nav?li?a").css("font-size","10px");
????????????$(".logo").css("padding","10px");
????????????$(".carousel-indicators").css({"bottom":"-10px"});
?????}
});
為了響應(yīng)式適配移動(dòng)端,寫了一坨js的hide代碼,是不是很爛?實(shí)習(xí)生
erutdioup8556
2016-07-15 17:31:55