css3实现3D切割轮播图案例
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>CSS3 3D切割轮播图</title>
<style>
body {
margin: 0;
padding: 0;
} ul {
margin: 0;
padding: 0;
list-style: none;
height: 100%;
width: 100%;
} .view {
width: 560px;
height: 300px;
border: 1px solid #ccc;
margin: 100px auto;
position: relative;
} /*大盒子*/
.view ul {
width: 560px;
height: 300px;
/*3d呈现*/
/*transform-style: preserve-3d;*/
} .view ul li {
width: 112px;
height: 300px;
float: left;
position: relative;
/*3d呈现*/
transform-style: preserve-3d;
} .view ul li span {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
} .view ul li span:nth-child(1) {
background-image: url("images/1.jpg");
background-repeat: no-repeat;
transform:translateZ(150px);
} .view ul li span:nth-child(2) {
background-image: url("images/2.jpg");
background-repeat: no-repeat;
transform: translateY(-150px) rotateX(90deg);
} .view ul li span:nth-child(3) {
background-image: url("images/3.jpg");
background-repeat: no-repeat;
transform: translateZ(-150px) rotateX(180deg);
} .view ul li span:nth-child(4) {
background-image: url("images/4.jpg");
background-repeat: no-repeat;
transform: translateY(150px) rotateX(270deg);
} .view ul li:nth-child(2) span {
background-position: -112px;
} .view ul li:nth-child(3) span {
background-position: -224px;
} .view ul li:nth-child(4) span {
background-position: -336px;
} .view ul li:nth-child(5) span {
background-position: -448px;
} /*3d转换 旋转*/
.view ul li {
transition: all 1s;
/*transform: translateZ(150px);*/ /*transform-origin: center center -150px;*/
} /*按钮*/
.prev, .next {
display: block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
margin-top: -30px;
font-size: 40px;
color: #FFF;
text-decoration: none;
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 50%;
} .next {
right: 0;
} </style>
</head>
<body>
<div class="view">
<ul>
<li><span></span><span></span><span></span><span></span></li>
<li><span></span><span></span><span></span><span></span></li>
<li><span></span><span></span><span></span><span></span></li>
<li><span></span><span></span><span></span><span></span></li>
<li><span></span><span></span><span></span><span></span></li>
</ul>
<a href="javascript:;" class="prev"><</a>
<a href="javascript:;" class="next">></a>
</div> <script src="js/jquery.min.js"></script>
<script>
$(function () {
var count = 0;
$('.prev').on('click', function () {
count ++;
$('li').css('transform','rotateX('+count*90+'deg)').each(function(index){
$(this).css('transition-delay',index*0.25+'s');
});
})
$('.next').on('click', function () {
count -- ;
$('li').css('transform','rotateX('+count*90+'deg)').each(function(index){
$(this).css('transition-delay',index*0.25+'s');
});
})
});
</script>
</body>
</html>
css3实现3D切割轮播图案例的更多相关文章
- 案例:3D切割轮播图
一.3d转换 3D旋转套路:顺着轴的正方向看,顺时针旋转是负角度,逆时针旋转是正角度 二.代码 <!DOCTYPE html> <html lang="en"&g ...
- 带锁的3D切割轮播图
3D切割轮播图. 加入锁,限制点击太快次数 <!DOCTYPE html><html><head lang="en"> <meta cha ...
- 3D切割轮播图
预览图: 实现原理:将图片切割构建一个和ul(电脑屏幕)同一个轴的立方体,利用延时旋转实现切割效果 知识点:transform-style属性(必须搭配transform属性使用) 值 描述 flat ...
- CSS3+JS切割轮播图
以下说明数据,是指有4张图片的轮播图,分别切割成4张. 首先,做成单张切换的立体效果,即通过旋转,确定四张图片的位置,分别是一个立方体的上下前后的图片翻转移动角度. .box ul li:nth-ch ...
- CSS3最简洁的轮播图
<!DOCTYPE html> <html> <head> <title>CSS3最简洁的轮播图</title> <style> ...
- js访3d上下轮播图
js/css访3d上下轮播图 (附件) <!DOCTYPE html> <html> <head> <meta charset="utf-8&quo ...
- CSS3,3D效果轮播图
---恢复内容开始--- 大家还记得我昨天的3D拖拽立方体吗??我昨天还说过css还可以做轮播图,所以咱们今天就写一下,css的轮播图吧! ....这个轮播图主要是用CSS3里的transform的旋 ...
- js原生代码实现轮播图案例
一.轮播图是现在网站网页上最常见的效果之一,对于轮播图的功能,要求不同,效果也不同! 我们见过很多通过不同的方式,实现这一效果,但是有很多比较麻烦,而且不容易理解,兼容性也不好. 在这里分享一下,用j ...
- transform—切割轮播图
效果演示: 1.结构分析 第一步:在一个div里面有显示图片的ul标签(1个)和左右切换的a标签(2个): 第二步:ul标签中有5个li标签,li标签浮动,每个li标签的宽度占ul宽度的五分之一,高度 ...
随机推荐
- react-native 横向滚动的商品展示
在app中会有这种页面 像这样商品是横向的,而且要滚动,思路是利用 ScrollView 横向的滚动 思路: (a): 横向滚动的整体作为一个组件 ShopCenter {/*** 横向滚动 *** ...
- DD打卡
一.安装逍遥安卓模拟器 二.安装钉钉 三.设置当前GPS座标 位置模拟器: 链接: https://pan.baidu.com/s/1TC5QkrGAgHOJWtzJnX6vhA 提取码: bpu8 ...
- res对象json,redirect
1.res.json() var express=require('express'); var app=express(); app.get('/',function(req,res){ //返回j ...
- html表单练习
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- [luogu4162 SCOI2009] 最长距离(最短路)
传送门 Solution 题目是最长路,其实是最短路ヽ(ー_ー)ノ 把进入障碍点的边设为1,其他为0.枚举每个点为起点找距离<=T的点,更新答案 Code //By Menteur_Hxy #i ...
- 当svn检出项目检出一半时停止,如何继续检出
1.当svn检出项目时,发现中断,又不想重新检出可以在已检出的项目目录下右键 2.然后点击 之后直接update你的项目就可以了
- 常用rides命令
rides使用步骤 1.源代码构建安装 1.下载,Linux下命令wget http://redis.io/download下载redis的包 2.解归档Linux下命令tar -xvf redis- ...
- 继续聊WPF——自定义滚动条
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winf ...
- AtCoder ABC 076D - AtCoder Express
传送门:http://abc076.contest.atcoder.jp/tasks/abc076_d 本题是一个运动学问题——匀变速运动. 一个质点,从静止开始运动.按照速度限制,可将运动划分成n个 ...
- 【ACM】hdu_1042_N!_201308071639
N!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...