jquery css 逐漸增加div的大小

來源:互聯網
上載者:User
<script type="text/javascript" src="http://www.cnblogs.com/0banana0/admin/&rdquo;http:/ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&rdquo;"></script>
<script type="text/javascript">// <![CDATA[
$(function(){
$("#id").click(function() {
$(this).css({
width: function(index, value) {
alert(value);
return parseFloat(value) * 1.2;
},
height: function(index, value) {
alert(value);
return parseFloat(value) * 1.2;
}

});
});
});
// ]]></script>
<div id="id" style="background: Red; width: 50px; heigth: 50px;">sa</div>

效果 點擊紅色的層

sa

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.