利用HTML5實現全屏商品選擇圖片切換代碼



23 90 31



特效描述:利用HTML5實現 全屏商品 選擇圖片 切換代碼,利用HTML5實現全屏商品選擇圖片切換代碼

代碼結構

1. 引入CSS

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

2. 引入JS

<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/TweenMax.min.js"></script>
<script src="js/demo.js"></script>
<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/TweenMax.min.js"></script>
<script src="js/demo.js"></script>

3. HTML代碼

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<script>
	document.documentElement.className = "js";
	var supportsCssVars = function() { var e, t = document.createElement("style"); return t.innerHTML = "root: { --tmp-var: bold; }", document.head.appendChild(t), e = !!(window.CSS && window.CSS.supports && window.CSS.supports("font-weight", "var(--tmp-var)")), t.parentNode.removeChild(t), e };
	supportsCssVars() || alert("Please view this demo in a modern browser that supports CSS Variables.");
</script>
</head>
<body class="loading">
<svg class="hidden">
	<symbol id="icon-arrow" viewBox="0 0 24 24">
		<title>arrow</title>
		<polygon points="6.3,12.8 20.9,12.8 20.9,11.2 6.3,11.2 10.2,7.2 9,6 3.1,12 9,18 10.2,16.8 " />
	</symbol>
	<symbol id="icon-drop" viewBox="0 0 24 24">
		<title>drop</title>
		<path d="M12,21c-3.6,0-6.6-3-6.6-6.6C5.4,11,10.8,4,11.4,3.2C11.6,3.1,11.8,3,12,3s0.4,0.1,0.6,0.3c0.6,0.8,6.1,7.8,6.1,11.2C18.6,18.1,15.6,21,12,21zM12,4.8c-1.8,2.4-5.2,7.4-5.2,9.6c0,2.9,2.3,5.2,5.2,5.2s5.2-2.3,5.2-5.2C17.2,12.2,13.8,7.3,12,4.8z" />
		<path d="M12,18.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7c1.3,0,2.4-1.1,2.4-2.4c0-0.4,0.3-0.7,0.7-0.7c0.4,0,0.7,0.3,0.7,0.7C15.8,16.5,14.1,18.2,12,18.2z" />
	</symbol>
	<symbol id="icon-instagram" viewBox="0 0 24 24">
		<title>instagram</title>
		<path d="M17 1h-10c-3.3 0-6 2.7-6 6v10c0 3.3 2.7 6 6 6h10c3.3 0 6-2.7 6-6v-10c0-3.3-2.7-6-6-6zM21 17c0 2.2-1.8 4-4 4h-10c-2.2 0-4-1.8-4-4v-10c0-2.2 1.8-4 4-4h10c2.2 0 4 1.8 4 4v10z"></path>
		<path d="M12.8 7c-0.5-0.1-1-0.1-1.5 0-2.7 0.4-4.6 3-4.2 5.7 0.2 1.3 0.9 2.5 2 3.3 0.9 0.6 1.9 1 3 1 0.2 0 0.5 0 0.7-0.1 1.3-0.2 2.5-0.9 3.3-2s1.1-2.4 0.9-3.7c-0.3-2.2-2-3.9-4.2-4.2zM14.5 13.7c-0.5 0.6-1.2 1.1-2 1.2-1.6 0.2-3.2-0.9-3.4-2.5-0.3-1.6 0.9-3.2 2.5-3.4 0.1 0 0.3 0 0.4 0s0.3 0 0.4 0c1.3 0.2 2.3 1.2 2.5 2.5 0.2 0.8 0 1.6-0.4 2.2z"></path>
		<path d="M16.8 5.8c-0.2 0.2-0.3 0.4-0.3 0.7s0.1 0.5 0.3 0.7c0.2 0.2 0.5 0.3 0.7 0.3 0.3 0 0.5-0.1 0.7-0.3s0.3-0.5 0.3-0.7c0-0.3-0.1-0.5-0.3-0.7-0.4-0.4-1-0.4-1.4 0z"></path>
	</symbol>
	<symbol id="icon-twitter" viewBox="0 0 24 24">
		<title>twitter</title>
		<path d="M23.6 2.2c-0.3-0.2-0.8-0.2-1.1 0-0.7 0.5-1.5 0.9-2.3 1.2-2-1.8-5.1-1.9-7.2-0.1-1.3 1.1-2 2.6-2 4.2-2.9-0.2-5.5-1.7-7.2-4.1-0.2-0.3-0.5-0.4-0.9-0.4s-0.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art</title>
		<path d="M11 21c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
		<path d="M22 21c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
		<path d="M23.8 5.4c-0.2-0.3-0.5-0.4-0.8-0.4h-16.2l-0.8-4.2c-0.1-0.5-0.5-0.8-1-0.8h-4c-0.6 0-1 0.4-1 1s0.4 1 1 1h3.2l0.8 4.2c0 0 0 0.1 0 0.1l1.7 8.3c0.3 1.4 1.5 2.4 2.9 2.4 0 0 0 0 0.1 0h9.7c1.5 0 2.7-1 3-2.4l1.6-8.4c0-0.3 0-0.6-0.2-0.8zM20.4 14.2c-0.1 0.5-0.5 0.8-1 0.8h-9.7c-0.5 0-0.9-0.3-1-0.8l-1.5-7.2h14.6l-1.4 7.2z"></path>
	</symbol>
	<symbol id="icon-caret" viewBox="0 0 16 24">
		<title>caret</title>
		<path d="M15.45 2.8L12.65 0l-12 12 12 12 2.8-2.8-9.2-9.2z"/>
	</symbol>
</svg>
<main>
	<div class="message">To see the box navigation please view on desktop</div>
	<div class="content content--fixed">
		<p class="tagline">Fine clothing since 1987</p>
		<h4 class="category">Spring / Summer 2019</h4>
	</div>
	<div class="slideshow">
		<div class="slide">
			<div class="slide__wrap">
				<div class="slide__img" style="background-image: url(img/1.jpg);"></div>
				<div class="slide__title-wrap">
					<h3 class="slide__title">Fancy Hats</h3>
					<h4 class="slide__subtitle">Pivot gnarly ho-ho drop in mute-air shoveit airwalk</h4>
				</div>
			</div>
		</div>
		<div class="slide">
			<div class="slide__wrap">
				<div class="slide__img" style="background-image: url(img/2.jpg);"></div>
				<div class="slide__title-wrap">
					<h3 class="slide__title">Shirt Mania</h3>
					<h4 class="slide__subtitle">Christ air pivot nosebone feeble quarter pipe</h4>
				</div>
			</div>
		</div>
		<div class="slide">
			<div class="slide__wrap">
				<div class="slide__img" style="background-image: url(img/3.jpg);"></div>
				<div class="slide__title-wrap">
					<h3 class="slide__title">Flow Scarfs</h3>
					<h4 class="slide__subtitle">Layback goofy footed transfer birdie Julien Stranger</h4>
				</div>
			</div>
		</div>
		<div class="slide">
			<div class="slide__wrap">
				<div class="slide__img" style="background-image: url(img/4.jpg);"></div>
				<div class="slide__title-wrap">
					<h3 class="slide__title">Back Secrets</h3>
					<h4 class="slide__subtitle">Nollie risers salad grind frigid air the faction</h4>
				</div>
			</div>
		</div>
	</div><!-- /slideshow -->
	<nav class="boxnav">
		<button class="boxnav__item boxnav__item--prev">
			<svg class="icon icon--caret">
				<use xlink:href="#icon-caret"></use>
			</svg>
		</button>
		<div class="boxnav__item boxnav__item--label">
			<span class="boxnav__label boxnav__label--current">1</span>
			<span class="boxnav__label boxnav__label--total"></span>
		</div>
		<button class="boxnav__item boxnav__item--next">
			<svg class="icon icon--caret-rot">
				<use xlink:href="#icon-caret"></use>
			</svg>
		</button>
	</nav>
	<button class="action action--details">+ details</button>
	<!-- details -->
	<div class="details-wrap">
		<div class="details">
			<div class="details__item details__item-img" data-direction="ttb">
				<div class="details__inner">
					<img src="img/small/1.jpg" alt="Some image"/>
				</div>
			</div>
			<div class="details__item details__item-sizes">
				<div class="details__inner details__inner--sizes">
					<span class="details__size">XL</span>
					<span class="details__size">L</span>
					<span class="details__size details__size--selected">M</span>
					<span class="details__size">S</span>
				</div>
			</div>
			<div class="details__item details__item--addtocart" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--addtocart">
						<svg class="icon icon--cart"><use xlink:href="#icon-cart"></use></svg>
					</button>
				</div>
			</div>
			<div class="details__item details__item-colors" data-direction="ttb">
				<div class="details__inner details__inner--grid details__inner--colors">
					<span class="details__color details__color--white">White</span>
					<span class="details__color details__color--red">Red</span>
					<span class="details__color details__color--black">Black</span>
					<span class="details__color details__color--blue">Blue</span>
					<span class="details__color details__color--beige">Beige</span>
					<span class="details__color details__color--sky">Sky</span>
				</div>
			</div>
			<div class="details__item details__item-price">
				<div class="details__inner details__inner--price">$89</div>
			</div>
			<div class="details__item details__item--close" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--close">Close</button>
				</div>
			</div>
		</div><!-- /details -->
		<div class="details">
			<div class="details__item details__item-img" data-direction="ttb">
				<div class="details__inner">
					<img src="img/small/2.jpg" alt="Some image"/>
				</div>
			</div>
			<div class="details__item details__item-sizes">
				<div class="details__inner details__inner--sizes">
					<span class="details__size">XL</span>
					<span class="details__size">L</span>
					<span class="details__size details__size--selected">M</span>
					<span class="details__size">S</span>
				</div>
			</div>
			<div class="details__item details__item--addtocart" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--addtocart">
						<svg class="icon icon--cart"><use xlink:href="#icon-cart"></use></svg>
					</button>
				</div>
			</div>
			<div class="details__item details__item-colors" data-direction="ttb">
				<div class="details__inner details__inner--grid details__inner--colors">
					<span class="details__color details__color--white">White</span>
					<span class="details__color details__color--red">Red</span>
					<span class="details__color details__color--black">Black</span>
					<span class="details__color details__color--blue">Blue</span>
					<span class="details__color details__color--beige">Beige</span>
					<span class="details__color details__color--sky">Sky</span>
				</div>
			</div>
			<div class="details__item details__item-price">
				<div class="details__inner details__inner--price">$119</div>
			</div>
			<div class="details__item details__item--close" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--close">Close</button>
				</div>
			</div>
		</div><!-- /details -->
		<div class="details">
			<div class="details__item details__item-img" data-direction="ttb">
				<div class="details__inner">
					<img src="img/small/3.jpg" alt="Some image"/>
				</div>
			</div>
			<div class="details__item details__item-sizes">
				<div class="details__inner details__inner--sizes">
					<span class="details__size">XL</span>
					<span class="details__size">L</span>
					<span class="details__size details__size--selected">M</span>
					<span class="details__size">S</span>
				</div>
			</div>
			<div class="details__item details__item--addtocart" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--addtocart">
						<svg class="icon icon--cart"><use xlink:href="#icon-cart"></use></svg>
					</button>
				</div>
			</div>
			<div class="details__item details__item-colors" data-direction="ttb">
				<div class="details__inner details__inner--grid details__inner--colors">
					<span class="details__color details__color--white">White</span>
					<span class="details__color details__color--red">Red</span>
					<span class="details__color details__color--black">Black</span>
					<span class="details__color details__color--blue">Blue</span>
					<span class="details__color details__color--beige">Beige</span>
					<span class="details__color details__color--sky">Sky</span>
				</div>
			</div>
			<div class="details__item details__item-price">
				<div class="details__inner details__inner--price">$65</div>
			</div>
			<div class="details__item details__item--close" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--close">Close</button>
				</div>
			</div>
		</div><!-- /details -->
		<div class="details">
			<div class="details__item details__item-img" data-direction="ttb">
				<div class="details__inner">
					<img src="img/small/4.jpg" alt="Some image"/>
				</div>
			</div>
			<div class="details__item details__item-sizes">
				<div class="details__inner details__inner--sizes">
					<span class="details__size">XL</span>
					<span class="details__size">L</span>
					<span class="details__size details__size--selected">M</span>
					<span class="details__size">S</span>
				</div>
			</div>
			<div class="details__item details__item--addtocart" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--addtocart">
						<svg class="icon icon--cart"><use xlink:href="#icon-cart"></use></svg>
					</button>
				</div>
			</div>
			<div class="details__item details__item-colors" data-direction="ttb">
				<div class="details__inner details__inner--grid details__inner--colors">
					<span class="details__color details__color--white">White</span>
					<span class="details__color details__color--red">Red</span>
					<span class="details__color details__color--black">Black</span>
					<span class="details__color details__color--blue">Blue</span>
					<span class="details__color details__color--beige">Beige</span>
					<span class="details__color details__color--sky">Sky</span>
				</div>
			</div>
			<div class="details__item details__item-price">
				<div class="details__inner details__inner--price">$99</div>
			</div>
			<div class="details__item details__item--close" data-direction="ttb">
				<div class="details__inner">
					<button class="action action--close">Close</button>
				</div>
			</div>
		</div><!-- /details -->
	</div>
</main>
</body>
</html>



用戶評論
大牛,別默默的看了,快登錄幫我點評一下吧!:)      登錄 | 注冊


熱門標簽: 圖片拖動 圖片拖拽 圖片放大鏡 圖片疊加 圖片層疊 圖片翻轉 圖片旋轉 圖片延遲加載 圖片延遲 圖片加載 圖片淡出淡進 圖片淡出 圖片淡進 圖片全屏 頭像上傳 圖片上傳 二維碼 圖片廣告 圖片放大縮小 圖片縮放 圖片大小 圖片放大 圖片縮小 圖片變大 圖片變小 h5圖片動畫 h5圖標動畫 html5圖片動畫 html5圖標動畫 帶縮略圖的幻燈片 地圖 中國地圖 世界地圖 flash焦點圖 flash幻燈片 flashbanner flash圖片輪播 圖片滾動 圖片滾動條 圖片滑動 圖片滑塊 圖片切換 圖片選項卡 圖標選項卡 圖片收縮展開 圖片收縮 圖片展開 旋轉木馬 圖片旋轉木馬 文字旋轉木馬 旋轉木馬插件 純圖片輪播 圖片輪播 自動滾動圖片輪播 圖標導航 圖標菜單 背景切換 大圖切換 手風琴 水平手風琴 垂直手風琴 圖片手風琴 文字手風琴 手風琴插件 切換按鈕 表單 表單美化 表單插件 表單美化插件 圖表 焦點圖 幻燈片 輪播圖 bar焦點圖 圖片 圖片插件 頭像截圖 純圖片輪播 圖片輪播 圖片切換 切換圖片 按鈕控制
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

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

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

老夫子电子 福建快三中奖助手 iveryone 可以赚钱吗 1.79篮彩复仇 有没有人搞传销赚钱 七乐彩走势图图 股票分析师资格证 快3彩票1.98 贵州11选五走势图 湖北十一选五任五遗漏 怎么给公众号投稿赚钱吗 山西快乐10分平台 五指娱乐五子棋是病毒 北单6串1过滤模型研究 澳门买大小怎样玩 新疆时时彩96期开奖记录 腾讯欢乐斗地主下载