判断屏幕大小,加载新样式

判断屏幕大小,加载新样式,适应小屏幕

<
div class="bg01"> <div class="w1060"> <div class="w_left"> <ul> <li class="li01"><b>纯信用</b><span>|</span>无需抵押和担保</li> <li class="li02"><b>纯线上</b><span>|</span>无需纸质资料 全部在线办理</li> <li class="li03"><b>申请易</b><span>|</span>只需身份证和必要授权</li> <li class="li04"><b>随时还</b><span>|</span>等额本息 支持随借随还</li> <li class="li05"><b>期限长</b><span>|</span>额度有效期3年,单笔最长用款期限1年</li> </ul> </div> <div class="w_right"></div> </div> </div> .bg01{ background:url(../images/baner.jpg) no-repeat center top; height:522px; padding-top:360px;} .w1060{ width:1060px; margin:0 auto;} .w_left{ width:640px; float:left;} .w_right{ background:url(../images/ewm1.png) no-repeat; width:366px; height:402px; float:right;} .w_left ul li{ font-size:24px; color:#FFF; height:70px; line-height:70px; text-indent:58px; margin-top:8px;} .w_left ul li b{ font-weight:bold;} .w_left ul li span{ padding:0 10px; font-weight:normal; font-size:20px;} .w_left ul li.li01{ background:url(../images/ico1.png) no-repeat left center;} .w_left ul li.li02{ background:url(../images/ico2.png) no-repeat left center;} .w_left ul li.li03{ background:url(../images/ico3.png) no-repeat left center;} .w_left ul li.li04{ background:url(../images/ico4.png) no-repeat left center;} .w_left ul li.li05{ background:url(../images/ico5.png) no-repeat left center;} .layout-1201 .bg01{ background:url(../images/banner01.jpg) no-repeat center top; height:300px; padding-top:360px;} .layout-1201 .w1060{ margin-top:-120px;} .layout-1201 .w_left ul li{ font-size:20px; color:#FFF; height:60px; line-height:60px; text-indent:58px; margin-top:8px;} .layout-1201 .w_left{ width:580px; float:left; padding-left:60px;} .layout-1201 .w_right{ background:url(../images/ewm2.png) no-repeat; width:336px; height:364px; float:right; margin-right:30px;} <script type="text/javascript" src="https://style.org.hc360.com/js/ppz/jquery-1.10.2.min.js"></script> <script> // JavaScript Document $(document).ready(function(){ /*** [throttle 函数节流] */ function throttle(fn, delay) { var timer = null; return function() { var _this = this, _args = arguments; clearTimeout(timer); timer = setTimeout(function() { fn.apply(_this, _args); }, delay); }; } /*** [resetBodyWidth 重置body大小]*/ function resetBodyWidth() { var _width = $(window).width(), _body = $(document.body); if (_width < 1440) { _body.addClass('layout-1201'); } else { _body.removeClass('layout-1201'); } } /*** [绑定窗口大小变化事件]*/ $(window).on('resize.layout', throttle(function() { /** * 重置body大小 */ resetBodyWidth(); }, 100)); /** * 重置body大小 */ resetBodyWidth(); }); </script>

 

posted @ 2020-08-04 16:13  南瓜小园  阅读(209)  评论(0编辑  收藏  举报