本文實例講述了JQuery實現鼠標移動圖片顯示描述層的方法。分享給大家供大家參考。具體如下:
這里可結合 JQuery easing 的動畫來配合使用。
主要代碼如下:
$(".item").hover(function(){//$(this).children("img").stop().animate({opacity: 0.8}, 700, "easeInSine");$(this).children("div.title").stop().animate({top: 0}, 700, "easeOutBounce");$(this).children("div.desc").stop().animate({bottom: 0}, 700, "easeOutBounce");},function(){//$(this).children("img").stop().animate({opacity: 1}, 700);$(this).children("div.title").stop().animate({top: -60}, 500);$(this).children("div.desc").stop().animate({bottom: -40}, 400);});
希望本文所述對大家的jQuery程序設計有所幫助。
新聞熱點
疑難解答