Last active
December 30, 2015 07:49
-
-
Save lgmcolin/7799011 to your computer and use it in GitHub Desktop.
用translate3d实现input拉长 效果:http://jsbin.com/uqODOPi/1/edit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body { | |
margin: 100px; | |
} | |
.clipped { | |
position: relative; | |
width: 154px; | |
} | |
.clipped .clip { | |
position: absolute; | |
right: 0px; | |
width: 50px; | |
height: 25px; | |
border: 2px solid #CCC; | |
border-radius: 0 4px 4px 0; | |
border-left: 0px; | |
pointer-events: none; | |
} | |
input { | |
-webkit-transition: -webkit-transform 400ms ease; | |
border: 2px solid #CCC; | |
border-radius: 4px; | |
border-right: 0px; | |
height: 25px; | |
width: 150px; | |
} | |
input:focus { | |
-webkit-transform: translate3d(-40px, 0, 0); | |
outline: none; | |
} | |
<style> | |
<body> | |
<div class="clipped"> | |
<div class="clip"></div> | |
<input type="text" /> | |
</div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment