css缩放样式案例
来源:互联网 发布:淘宝开店起步 编辑:程序博客网 时间:2024/05/20 04:10
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css缩放样式</title>
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(function(){
$("ul li:not('.li-bg')").mouseover(function(){
$("ul li.li-bg").removeClass("show").css({'left':$(this).position().left}).addClass("show");
});
});
</script>
<style type="text/css">
ul{
position:relative;
height:auto;
overflow:hidden;
}
ul, li{
margin:0px;
padding:0px;
list-style:none;
}
ul li{
width: 135px;
height: 160px;
line-height:100px;
float: left;
text-align:center;
position: relative;
z-index: 2;
}
ul li.li-bg{
position: absolute;
top: 0px;
left:0px;
width: 135px;
height: 100px;
background:red;
border-radius:0px;
z-index: 1;
}
/** 缩放动画 */
.show{
-webkit-animation:showout .3s ease-out both;
-moz-animation:showout .3s ease-out both;
-o-animation:showout .3s ease-out both;
animation-:showout .3s ease-out both;
}
@-webkit-keyframes showout {
0% { -webkit-transform: scale(0.5); opacity:0 }
100% { -webkit-transform: scale(1); opacity:1 }
}
@-moz-keyframes showout {
0% { -moz-transform: scale(0.5); opacity:0}
100% { -moz-transform: scale(1); opacity:1}
}
@keyframes showout {
0% {transform: scale(0.5); opacity:0 }
100% {transform: scale(1); opacity:1 }
}
</style>
</head>
<body>
<ul>
<li>标题一</li>
<li>标题一</li>
<li>标题一</li>
<li>标题一</li>
<li class="li-bg"></li>
</ul>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css缩放样式</title>
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(function(){
$("ul li:not('.li-bg')").mouseover(function(){
$("ul li.li-bg").removeClass("show").css({'left':$(this).position().left}).addClass("show");
});
});
</script>
<style type="text/css">
ul{
position:relative;
height:auto;
overflow:hidden;
}
ul, li{
margin:0px;
padding:0px;
list-style:none;
}
ul li{
width: 135px;
height: 160px;
line-height:100px;
float: left;
text-align:center;
position: relative;
z-index: 2;
}
ul li.li-bg{
position: absolute;
top: 0px;
left:0px;
width: 135px;
height: 100px;
background:red;
border-radius:0px;
z-index: 1;
}
/** 缩放动画 */
.show{
-webkit-animation:showout .3s ease-out both;
-moz-animation:showout .3s ease-out both;
-o-animation:showout .3s ease-out both;
animation-:showout .3s ease-out both;
}
@-webkit-keyframes showout {
0% { -webkit-transform: scale(0.5); opacity:0 }
100% { -webkit-transform: scale(1); opacity:1 }
}
@-moz-keyframes showout {
0% { -moz-transform: scale(0.5); opacity:0}
100% { -moz-transform: scale(1); opacity:1}
}
@keyframes showout {
0% {transform: scale(0.5); opacity:0 }
100% {transform: scale(1); opacity:1 }
}
</style>
</head>
<body>
<ul>
<li>标题一</li>
<li>标题一</li>
<li>标题一</li>
<li>标题一</li>
<li class="li-bg"></li>
</ul>
</body>
</html>
0 0
- css缩放样式案例
- css样式案例
- 关于css超链接样式的小案例
- css样式小结和脚本实现图片按比例缩放
- nuxt案例全局CSS丢失的那部分样式
- CSS样式如何控超过页面宽度的图片正比例缩放
- CSS样式之transform(对元素的旋转、缩放、移动或倾斜)
- CSS-网页字体缩放样式-webkit-text-size-adjust的用法详解
- 杂记(一些CSS的透明,阴影,渐变样式以及关于浏览器缩放的对应操作)
- css 案例
- CSS样式
- CSS样式
- css样式
- CSS样式
- CSS样式
- Css样式
- CSS样式
- CSS 样式
- OpenSSL源码分析之SHA0算法
- B - 士兵队列训练问题
- 由于要开发新的项目,node.js写下一些问题帮助自己记忆,也希望能帮助到别人
- Proguard android代码混淆 防止反编译
- 我的博客定位
- css缩放样式案例
- AIX 5.3安装SSH
- 4.struts2结果类型和struts2通配符和动态方法
- 【Ecstore2.0】计划任务/队列/导入导出 的执行问题
- spring的一些常用注解
- JPEG文件数据结构以及将位图保存为JPG的代码
- 创建weblogic启动文件,防止出现关闭控制台服务被关掉
- ubuntu14.04中安装opencv2.4.10
- 使用linq分组经验总结