jQuery爱奇艺广告图片切换代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery爱奇艺广告图片切换代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery爱奇艺广告图片切换代码

HTML代码(index.html):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery爱奇艺广告图片切换代码</title>
<link type="text/css" rel="stylesheet" href="index.css" />
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>

</head>
<body>
<div class="tggg">
	<div class="theatre-label">推广广告</div>
	<div class="tggg_ks">
		<div class="tggg_ks_1">
			<div class="tggg_zuojian tggg_jiantou" id="tggg_zuojian"></div>
			<div class="tggg_ks_2" id="limitbuy">
				<ul class="products">
					<li class="theatre-item tggg1">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-1.jpg">
									<img class="theatre-logo" src="images/tggg2-1.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_1.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg1">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-1.jpg">
									<img class="theatre-logo" src="images/tggg2-1.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_1.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg1">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-1.jpg">
									<img class="theatre-logo" src="images/tggg2-1.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_1.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg1">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-1.jpg">
									<img class="theatre-logo" src="images/tggg2-1.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_1.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg1">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-1.jpg">
									<img class="theatre-logo" src="images/tggg2-1.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_1.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg1">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-1.jpg">
									<img class="theatre-logo" src="images/tggg2-1.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_1.jpg">
								</div>
							</div>
						</a>
					</li>
				</ul>
				<ul class="products">
					<li class="theatre-item tggg2">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-2.jpg">
									<img class="theatre-logo" src="images/tggg2-2.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_2.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg2">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-2.jpg">
									<img class="theatre-logo" src="images/tggg2-2.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_2.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg2">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-2.jpg">
									<img class="theatre-logo" src="images/tggg2-2.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_2.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg2">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-2.jpg">
									<img class="theatre-logo" src="images/tggg2-2.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_2.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg2">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-2.jpg">
									<img class="theatre-logo" src="images/tggg2-2.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_2.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg2">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-2.jpg">
									<img class="theatre-logo" src="images/tggg2-2.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_2.jpg">
								</div>
							</div>
						</a>
					</li>
				</ul>
				<ul class="products">
					<li class="theatre-item tggg3">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-3.jpg">
									<img class="theatre-logo" src="images/tggg2-3.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_3.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg3">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-3.jpg">
									<img class="theatre-logo" src="images/tggg2-3.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_3.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg3">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-3.jpg">
									<img class="theatre-logo" src="images/tggg2-3.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_3.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg3">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-3.jpg">
									<img class="theatre-logo" src="images/tggg2-3.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_3.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg3">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-3.jpg">
									<img class="theatre-logo" src="images/tggg2-3.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_3.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg3">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-3.jpg">
									<img class="theatre-logo" src="images/tggg2-3.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_3.jpg">
								</div>
							</div>
						</a>
					</li>
				</ul>
				<ul class="products">
					<li class="theatre-item tggg4">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-4.jpg">
									<img class="theatre-logo" src="images/tggg2-4.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_4.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg4">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-4.jpg">
									<img class="theatre-logo" src="images/tggg2-4.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_4.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg4">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-4.jpg">
									<img class="theatre-logo" src="images/tggg2-4.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_4.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg4">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-4.jpg">
									<img class="theatre-logo" src="images/tggg2-4.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_4.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg4">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-4.jpg">
									<img class="theatre-logo" src="images/tggg2-4.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_4.jpg">
								</div>
							</div>
						</a>
					</li>
					<li class="theatre-item tggg4">
						<a href="">
							<div class="theatre-expand">
								<div class="theatre-left">
									<img class="theatre-poster" src="images/tggg1-4.jpg">
									<img class="theatre-logo" src="images/tggg2-4.jpg">
								</div>
								<div class="theatre-right">
									<img class="theatre-banner" src="images/tggg1-1_4.jpg">
								</div>
							</div>
						</a>
					</li>
				</ul>
			</div>
			<div class="tggg_youjian tggg_jiantou" id="tggg_youjian"></div>
		</div>
	</div>
</div>
<script>
	$(function(){
		var lb_cur = 1,
			t = 1;
		function showLimitBuyProducts(){
			if(lb_cur < 1){
				lb_cur = 4;
			}
			else if(lb_cur > 4){
				lb_cur = 1;
			}
			var products = $("#limitbuy .products").hide().eq(lb_cur-1).show(),
				ta = products.find("textarea");
		}
		//左边点击
		$("#tggg_zuojian").click(function(){
			lb_cur--;
			showLimitBuyProducts();
		});
		//右边点击
		$("#tggg_youjian").click(function(){
			lb_cur++;
			showLimitBuyProducts();
		});
		//手风琴样式
		$(".theatre-item").mouseover(function(){
			if($(this).index()==5){
				$(this).addClass('aa');
				$(this).siblings().addClass('bb');
				$(this).siblings().eq(0).removeClass('bb');
				//$('.theatre-item:eq(0)').removeClass('bb');

			}else{
				//console.log($(this).index());//调试jsconsole.log()获取li的下标
				$(this).addClass('aa');
				$(this).siblings().addClass('bb');
				$(this).next().attr('class','theatre-item');
			}
		})
		$(".theatre-item").mouseout(function(){
			$(this).attr('class','theatre-item');
			$(this).siblings().removeClass('bb');
		});
	});
</script>
</body>
</html>





CSS代码(index.css):

*{margin:0;padding:0;list-style:none;}
body{background:#ccc;}
a{text-decoration:none;}
img{border:none;}
.tggg{width:1180px !important;margin:0px auto;}
.tggg{display:block;opacity:1;padding:25px 0;clear:both;font-size:0;width:100%;}
.theatre-label{background:#8ac024;width:84px;color:#fff;font-size:12px;text-align:center;line-height:22px;border-radius:4px 4px 0 0;}
.tggg_ks{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:10px 1px;width:100%;border:1px solid #8ac024;position:relative;overflow:hidden;}
.tggg_ks_1{height:140px;overflow:hidden;margin:0 auto;width:1120px;}
.tggg_zuojian{left:4px;background:url("images/arrow-left.png") no-repeat 50%;}
.tggg_zuojian:hover{background:url("images/arrow-left-hover.png") no-repeat 50%;}
.tggg_youjian{right:4px;background:url("images/arrow-right.png") no-repeat 50%;}
.tggg_youjian:hover{background:url("images/arrow-right-hover.png") no-repeat 50%;}
.tggg_jiantou{width:15px;height:26px;cursor:pointer;text-indent:-999px;position:absolute;top:50%;margin-top:-13px;}
.tggg_ks_2{width:5000px;height:170px;margin-left:-10px;display:inline-block;line-height:0;}
.theatre-item{width:170px;overflow:hidden;transition:all .7s cubic-bezier(.46,.98,.54,1.1);-webkit-transition:all .7s cubic-bezier(.46,.98,.54,1.1);-moz-transition:all .7s cubic-bezier(.46,.98,.54,1.1);-o-transition:all .7s cubic-bezier(.46,.98,.54,1.1);float:left;margin:0 10px;background-color:#fff;cursor:pointer;s}
.theatre-expand{width:930px;}
.theatre-left{float:left;width:170px;}
.theatre-left img{width:100%;display:block;}
.theatre-poster{height:100px;}
.theatre-logo{height:40px;}
.theatre-right{float:left;margin-left:20px;}
.theatre-banner{opacity:0;transition:all .7s cubic-bezier(.46,.98,.54,1.1);-webkit-transition:all .7s cubic-bezier(.46,.98,.54,1.1);-moz-transition:all .7s cubic-bezier(.46,.98,.54,1.1);-o-transition:all .7s cubic-bezier(.46,.98,.54,1.1);width:740px;display:block;}
.aa{width:930px;z-index:100;}
.aa .theatre-banner{opacity:1;}
.bb{width:0px;margin:0px;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
268.18 KB
Html Js 手拉琴特效
最新结算
股权转让协议意向书模板
类型: .docx 金额: CNY 2.23¥ 状态: 待结算 详细>
股权转让协议意向书模板
类型: .docx 金额: CNY 0.28¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 2.39¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 0.3¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章