模仿寫個jQuery版本有問題請指出
$("li").hover(
function () {
$(this.children[1]).stop().animate({"height":"120px"},200);
},
function () {
$(this.children[1]).stop().animate({"height":"0"},200);
}
)
$("li").hover(
function () {
$(this.children[1]).stop().animate({"height":"120px"},200);
},
function () {
$(this.children[1]).stop().animate({"height":"0"},200);
}
)
2017-08-26
核心代碼如下:
//鼠標經過一級菜單,二級菜單動畫下拉顯示出來
this.getElementsByTagName('ul')[0].style.overflow='visible';
//鼠標離開菜單,二級菜單動畫收縮起來。
this.getElementsByTagName('ul')[0].style.overflow='hidden';
//鼠標經過一級菜單,二級菜單動畫下拉顯示出來
this.getElementsByTagName('ul')[0].style.overflow='visible';
//鼠標離開菜單,二級菜單動畫收縮起來。
this.getElementsByTagName('ul')[0].style.overflow='hidden';
2017-08-23
圖片會降低網頁的訪問速度,提高瀏覽器的渲染時間,一般能用CSS解決的就不會用圖片來做,這是網頁性能優(yōu)化很重要的一個基本原則。