码迷,mamicode.com
首页 > Web开发 > 详细

css卷叶效果

时间:2015-03-18 15:42:18      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>22222</title>
<style>

.form{
width:405px;
height:200px;
background:Yellow;
position:relative;
overflow:hidden;
margin:30px auto;
}
.corner{
background: -webkit-linear-gradient(45deg, #2e2e2e 24%, #5F5F5F 40%,#6f6f6f 43%,#5F5F5F 46%,#2F2F2F 50%,#fff 50%,#fff);

width: 90px;
height:90px;
border-radius: 0 0 0px 90px / 0 0 0 30px;
-webkit-transform: rotate(-90deg);

position: absolute;
left:-4px;
top: -4px;
box-shadow: 5px 2px 8px black;
overflow:hidden;
-webkit-transition:all 0.3s linear 0s;

}

.corner:after{
height:100%;
width:100%;
position: absolute;
content: "56666666666";
top: -15px;
left: -82px;
border-radius: 90px 90px 0px 0 / 40px 40px 0 0;
z-index: 1;
background: Blue;
-webkit-transform: rotate(77deg);

box-shadow: 0px 0px 8px black inset;
}

 

 

</style>
</head>
<body>
<div class="page">
<div class="form" id="form">
<div class="corner" id="corner">
</div>
</div>
</div>
<script type="text/javascript">

var form = document.getElementById("form");
var corner = document.getElementById("corner")
var ftop = form.offsetTop;
var fleft = form.offsetLeft;
var switchopen = 0;
corner.onmousedown = function (e) {
e.preventDefault();
form.style.cursor = "move";
switchopen = 1;
}
form.onmousemove = function (e) {
if (switchopen == 1) {
if (e.pageX - fleft > 90 || e.pageY - ftop > 90) {
corner.style.width = corner.style.height = 90 + "px";
corner.style.left = corner.style.top = -4 + "px"
}
else {
corner.style.width = corner.style.height = e.pageY - ftop + "px";

}
}
}
form.onmouseup = function () {
switchopen = 0;
this.style.cursor = "default";
}

</script>
</body>
</html>

css卷叶效果

标签:

原文地址:http://www.cnblogs.com/zhwl/p/4347055.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!