html5 3D效果手机电脑里面滑动3D幻灯片轮播代码



109 435 146



特效描述:html5 3D效果 手机电脑里面 滑动3D幻灯片轮播,3D幻灯片轮播代码

代码结构

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/mockup1.css" />
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/mockup1.css" />

2. 引入JS

<script src="js/modernizr.custom.js"></script>
<script src="js/classie.js"></script>
<script src="js/main.js"></script>
<script src="js/modernizr.custom.js"></script>
<script src="js/classie.js"></script>
<script src="js/main.js"></script>

3. HTML代码

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Perspective Mockup Slideshow | Demo 1</title>
<!--必要样式-->
</head>
<body class="demo-1">
<div class="container">
	<div id="wrap" class="wrap">
		<div class="mockup">
			<img class="mockup__img" src="img/mockup.jpg" />
			<div id="mobile" class="mobile">
				<ul id="slideshow" class="slideshow">
					<li class="slideshow__item"><img src="img/small/1.png" /></li>
					<li class="slideshow__item"><img src="img/small/2.png" /></li>
					<li class="slideshow__item"><img src="img/small/3.png" /></li>
					<li class="slideshow__item"><img src="img/small/4.png" /></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="content">
		<nav class="codrops-demos">
			<a class="current-demo" href="index.html">Demo 1</a>
			<a href="index2.html">Demo 2</a>
			<a href="index3.html">Demo 3</a>
			<a href="index4.html">Demo 4</a>
		</nav>
	</div>
</div><!-- /container -->
<script>
(function() {
	new Slideshow( document.getElementById( 'slideshow' ) );
	/* Mockup responsiveness */
	var body = docElem = window.document.documentElement,
		wrap = document.getElementById( 'wrap' ),
		mockup = wrap.querySelector( '.mockup' ),
		mockupWidth = mockup.offsetWidth;
	scaleMockup();
	function scaleMockup() {
		var wrapWidth = wrap.offsetWidth,
			val = wrapWidth / mockupWidth;
		mockup.style.transform = 'scale3d(' + val + ', ' + val + ', 1)';
	}
	window.addEventListener( 'resize', resizeHandler );
	function resizeHandler() {
		function delayed() {
			resize();
			resizeTimeout = null;
		}
		if ( typeof resizeTimeout != 'undefined' ) {
			clearTimeout( resizeTimeout );
		}
		resizeTimeout = setTimeout( delayed, 50 );
	}
	function resize() {
		scaleMockup();
	}
})();
</script>
</body>
</html>



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


热门标签: 滑动 滚动切换 滑动选项卡切换 flash焦点图 选项卡切换 滑动手风琴 焦点图 幻灯片 图片轮播 图片滑动 图片切换 图片轮播

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

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

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