jQuery仿爱奇艺广告图片左右切换手风琴特效



137 545 182



特效描述:jQuery 仿爱奇艺广告 图片左右切换 手风琴特效,jQuery这是仿爱奇艺官网中广告推广特效 图片左右切换加手风琴

代码结构

1. 引入CSS

<link type="text/css" rel="stylesheet" href="index.css" />

2. 引入JS

<script type="text/javascript" src="jquery-1.11.3.min.js"></script>

3. HTML代码

	<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>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 滑动滑过 滚动切换 滑动选项卡切换 flash焦点图 叠加浮动层 选项卡切换 滑动手风琴 重叠层叠叠加 切换按钮 form表单 焦点图幻灯片 图片叠加 图片滑动 图片轮播 滑动手风琴 手风琴 按钮控制

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到