{
    分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

jQuery选项卡中嵌套选项卡切换效果

jQuery选项卡中嵌套选项卡切换效果,二级嵌套Tab切换代码,鼠标悬停选项卡即切换,还有二维码展示效果。


js代码

<script src="statics/js/jquery.min.js"></script>
<script type="text/javascript">
	$(function() {
		var i = 0; //初始变量
		var k = 0; //初始变量
		var h = 5; //默认第一个内容条数
		//分类tap
		$('.industry').hover(function() {
			i = $(this).index(); //当前索引
			$(this).addClass('active').siblings().removeClass('active');
			$('.case-panel').eq(i).addClass('active').siblings().removeClass('active');
			h = $('.case-panel').eq(i).find('.image-hover').length; //获取内容条数
		})
		//内容tap
		$('.case-panel .image-hover').hover(function() {
			var j = $(this).index();
			var src = $(this).attr('data-qrcode'); //data-qrcode属性里面是二维码的图片
			var title = $(this).attr('data-title'); //标题
			var desc = $(this).attr('data-desc'); //描述
			$(this).addClass('active').siblings().removeClass('active');
			$(this).parents('.case-panel').find('.phone-image').eq(j - 1).addClass('active').siblings().removeClass('active');
			$(this).parents('.case-panel').find('.phone-image-cover').find('img').attr('src', src);
			$(this).parents('.case-panel').find('.case-head').text(title);
			$(this).parents('.case-panel').find('.case-text').text(desc);
			
		})
		//图片二维码
		$('.phone-framework').hover(function() {
			$(this).next('.phone-image-cover').removeClass('hidden');
		}, function() {
			$('.phone-image-cover').addClass('hidden');
		})
		//自动执行,间隔5秒
		setInterval(function() {
			$('.case-panel').eq(i).find('.image-hover').eq(k).addClass('active').siblings().removeClass('active');
			$('.case-panel').eq(i).find('.phone-image').eq(k).addClass('active').siblings().removeClass('active');
			k >= h - 1 ? k = 0 : k++;
		}, 5000)
	})
</script>


在线预览
资源均来自第三方,谨慎下载,前往第三方网站下载


米微资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:jQuery选项卡中嵌套选项卡切换效果
喜欢 ()分享 (0)