亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

想要的效果是鼠標移入時此圖片變寬,鼠標移出時div變回原來的寬度

想要的效果是鼠標移入時此圖片變寬,鼠標移出時div變回原來的寬度

Echo_Chien 2016-09-02 22:22:03
<!doctype html><html><head><meta charset="utf-8"><title>無標題文檔</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"})? ? ? }) })
查看完整描述

1 回答

已采納
?
stone310

TA貢獻361條經驗 獲得超191個贊

$(function(){
????$(".div?img").mouseover(function(){
????????$(this).stop().animate({width:'300'
????????},1000).siblings().stop().animate({width:'225'
????????},1000)
????}).mouseout(function(){
????????$(this).stop().css({width:'250'
????????})
????})
})

不知道你要的是不是這種效果,主要添加stop(),為了在觸發執行時先將上一次動畫停止,之前觸發的未完成動畫會一直執行

查看完整回答
反對 回復 2016-09-03
  • 1 回答
  • 0 關注
  • 2165 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號