<!doctype html><html><head><meta charset="utf-8"><title>無(wú)標(biāo)題文檔</title><link href="css.css" rel="stylesheet"><script src="../../jquery/jquery-2.1.4.min.js"></script><script src="js.js"></script></head><body><div class="div"><img src="img/2.jpg"><img src="img/4.jpg"><img src="img/3.jpg"></div></body></html><!--下面是jQuery-->$(function(){ $(".div img").mousemove(function(){ $(this).animate({width:"300"},1000).siblings().animate({width:"225"},1000) }) .mouseout(function(){ $(this).css({width:"250"})? ? ? }) })
想要的效果是鼠標(biāo)移入時(shí)此圖片變寬,鼠標(biāo)移出時(shí)div變回原來(lái)的寬度
Echo_Chien
2016-09-02 22:22:03