<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<style>
div{
height: 10px;
width: 10px;
margin: 100px auto;
background-color: #007997;
transition:height 2s linear;
}
div.active{
margin: 200px auto;
width: 200px;
height: 50px;
}
</style>
<script>
$(function(){
console.log($("div").height());
setTimeout(function () {
$("div").addClass("active");
setTimeout(function () {
$("div").height(10);
},2000);
// $("input").clear("hello");
clearValue( $("input"),"2016");
},1000);
});
$.fn.clear = function(val){
$(this).val(val);
};
function clearValue($target,val){
$target.val("123");
}
</script>
</head>
<body>
<input type="text" value="12345">
<div></div>
</body>
</html>
CSS transition的用法
最新推荐文章于 2024-01-30 08:30:00 发布