jQuery仿愛奇藝廣告圖片左右切換手風琴特效



110 437 146



特效描述: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焦點圖 flash幻燈片 flashbanner flash圖片輪播 疊加浮動層 選項卡切換 選項卡 切換 tab切換 頁面切換 選項卡插件 切換插件 滑動手風琴 層疊疊加 疊加層疊 層疊 疊加 加載更多 切換按鈕 表單 表單美化 表單插件 表單美化插件 焦點圖 幻燈片 輪播圖 bar焦點圖 圖片疊加 圖片層疊 圖片滑動 圖片滑塊 純圖片輪播 圖片輪播 滑動手風琴 手風琴 水平手風琴 垂直手風琴 圖片手風琴 文字手風琴 手風琴插件 按鈕控制
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

jQuery/js討論群
群號:642649996
Css3+Html5討論群
群號:322131262

加群請備注:從官網了解到

老夫子电子