首先,需加載jquery庫(略過)。
其次,將下面 Javascript代碼加到頁面的頭部:
復制代碼 代碼如下:
<script type='text/javascript'>
jQuery(document).ready(function($){
$('a').hover(function()
{
$(this).stop().animate({'left': '5px'}, 'fast');
}, function() {
$(this).stop().animate({'left': '0px'}, 'fast');
});
});
</script>
復制代碼 代碼如下:
a {position:relative}
復制代碼 代碼如下:
a:hover { padding: 0 0 0 8px;}
新聞熱點
疑難解答
圖片精選