$(function () { setTimeout(function () { var winw = $(window).width(); function initHeight() { winw = $(window).width(); if (winw < 750) { // 设置移动head端横向滚动 var headWidth = 0; $('.dive-into-digital .con .top .head ul li').each(function () { headWidth += $(this).width(); }) $('.dive-into-digital .con .top .head ul').width(headWidth + 20) // 设置移动端min-box左右滚动 $('.dive-into-digital .con .bottom ul li').each(function () { var _this = $(this); var _length = _this.find('.min-box .box').length; _this.find('.scroll').width(winw * 0.7 * _length) }) // 设置min-box的width $('.dive-into-digital .con .bottom ul li .min-box .box').width(winw * 0.7 - 7.5) } // 下面小的box文字高度统一 $('.dive-into-digital .con .bottom ul li .min-box .box .text').height('auto'); baseLib.v3SetHeight(".dive-into-digital .con .bottom ul li .scroll", ".box", ".text"); // 初始化获取高度 $('.dive-into-digital .con .bottom ul li').each(function () { var _this = $(this); _this.height('auto'); var _index = $(this).index(); if (_index == 0 || winw < 992) { _this.attr('data-height', _this.height()); } else { if (_this.find('.min-box').length > 0) { _this.attr('data-height', _this.height() - 100); } else { _this.attr('data-height', _this.height()); } } }) $('.dive-into-digital .con .bottom ul').height($('.dive-into-digital .con .bottom ul li.active').attr('data-height')) } initHeight(); // 点击事件 $('.dive-into-digital .con .top .head ul li').on('click', function () { var _index = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $('.dive-into-digital .con .bottom ul li').eq(_index).addClass('active').siblings().removeClass('active'); $('.dive-into-digital .con .bottom ul').height($('.dive-into-digital .con .bottom ul li.active').attr('data-height')) }) var currentWinw = 0; var resizeSeeMoreInsights = ''; $(window).on('resize', function () { if (resizeSeeMoreInsights) { clearTimeout(resizeSeeMoreInsights); } resizeSeeMoreInsights = setTimeout(function () { winw = $(window).width(); var win = $(window); if (winw != currentWinw) { currentWinw = winw; initHeight(); } }, 500) }) }, 1000) })