<div class="container"><div class="tabs"><a href="#" hidefocus="true" class="active"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/tab1.png" width="100%"></a><a href="#" hidefocus="true"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/tab2.png" width="100%"></a></div><div class="swiper-container"><div class="swiper-wrapper"><div class="swiper-slide"><div class="content-slide"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/1-1.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/1-2.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/1-3.jpg" width="100%"></div></div><div class="swiper-slide"><div class="content-slide"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/2-1.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/2-2.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/2-3.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/2-4.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/2-5.jpg" width="100%"><img src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/images/2-6.jpg" width="100%"></div></div></div></div></div><script type="text/javascript" src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/files/jquery-1.10.1.min.js"></script><script type="text/javascript" src="http://imgd2.soufunimg.com/2015/05/06/chengdu/gebz/3e3fc71e76394f90b34e5399ebdaebe5/files/idangerous.swiper.min.js"></script><script type="text/javascript">var tabsSwiper = new Swiper('.swiper-container',{speed:500,onSwiperCreated:function(){var H=$(".content-slide").eq(0).height();$(".swiper-wrapper").css('height', H+'px');$(".swiper-slide").css('height', H+'px');},onSlideChangeStart: function() {var H = $(".content-slide").eq(tabsSwiper.activeIndex).height();$(".tabs .active").removeClass('active');$(".tabs a").eq(tabsSwiper.activeIndex).addClass('active');$(".swiper-slide").css('height', H + 'px');$(".swiper-wrapper").css('height', H + 'px');},});$(".tabs a").on('touchstart mousedown',function(e){var index=$(this).index();e.preventDefault()tabsSwiper.swipeTo(index);$(".tabs .active").removeClass('active');$(this).addClass('active');});$(".tabs a").click(function(e){e.preventDefault();});</script>
1 回答
咕咕问
TA贡献78条经验 获得超12个赞
1.是加载速度慢 导致选项卡显示不完全的问题
2.还是不论加载速度如何 都需要点击切换才能正常显示
把js禁掉,然后调整样式,都显示出来
所有引入的js放到</body>前面,防止js阻断页面渲染
添加回答
举报
0/150
提交
取消