您可以使用CSS Transition進行此操作。 使用css轉換可以爲div或對象設置動畫。
看看這個偉大的教程
https://developer.mozilla.org/en-US/docs/CSS/Tutorials/Using_CSS_transitions
一個例子:
JSFIDDLE
<body>
<p>The box below combines transitions for: width, height, background-color, transform. Hover over the box to see these properties animated.</p>
<div class="box"></div>
</body>
.box {
border-style: solid;
border-width: 1px;
display: block;
width: 100px;
height: 100px;
background-color: #0000FF;
-moz-transition:width 2s, height 2s, background-color 2s, -moz-transform 2s;
-webkit-transition:width 2s, height 2s, background-color 2s, -webkit-transform 2s;
-o-transition:width 2s, height 2s, background-color 2s, -o-transform 2s;
transition:width 2s, height 2s, background-color 2s, transform 2s;
}
.box:hover {
background-color: #FFCCCC;
width:200px;
height:200px;
-moz-transform:rotate(180deg);
-webkit-transform:rotate(180deg);
-o-transform:rotate(180deg);
transform:rotate(180deg);
}
希望這是你的意思。
你的意思就像一個雲,當你將鼠標放在元素上時,它就是放大? – 2013-04-24 09:47:04
您能否添加更好的描述?無論如何看看https://github.com/hakimel/zoom.js也許它會幫助你開始;) – 2013-04-24 09:56:53
ower重新加載 - thanx你的時間。我編輯了原始問題,實際上找到了我想要的東西 – Mathew 2013-04-24 15:22:33