純CSS實現圖片抖動
實現方法: 1.將上文提到的以下JS內容刪除: $(".imagelogo").mouseover(function() { obj = $(this); i = 5; timer = null; clearInterval(timer); timer ...
實現方法: 1.將上文提到的以下JS內容刪除: $(".imagelogo").mouseover(function() { obj = $(this); i = 5; timer = null; clearInterval(timer); timer ...
<li onmouseout="this.className='off'"><a href=""> src="../活力廣州_files/admin.png" a ...
...
...
把代碼加到style.css(模板的主css里面): /**圖片抖動**/ img:hover{-webkit-animation: tada 1s .2s ease both;-moz-animation: tada 1s .2s ease both ...
View Code ...
今天來寫一個關於圖片抖動的效果,需求是:點擊圖片,讓其抖動幾下停止(類似於蘋果手機填錯密碼之后會抖一下的效果),其實想要實現這個效果,原理就是,點擊之后,讓其左移動下然后右移動一下(每移動一下減幾像素知道減到0),然后將其放入定時器內,讓其慢慢自動停下來。來看代碼布局: 接下 ...