Javascript jQuery动画悬停问题

Javascript jQuery动画悬停问题,javascript,jquery,html,hover,Javascript,Jquery,Html,Hover,我为3幅图像编写了以下代码,因此当用户将鼠标悬停在图像上时,图像会略微缩放: <script> jQuery(document).ready(function() { jQuery('#global-banner-cp-39c170794c8a8dfc143d053961f61ce3 img').hover(function() { jQuery(this).animate({width: '+=25px'}, {duration: 2

我为3幅图像编写了以下代码,因此当用户将鼠标悬停在图像上时,图像会略微缩放:

<script>
    jQuery(document).ready(function() {
        jQuery('#global-banner-cp-39c170794c8a8dfc143d053961f61ce3 img').hover(function() {
            jQuery(this).animate({width: '+=25px'}, {duration: 250, queue: false});
            jQuery(this).animate({height: '+=25px'}, {duration: 250, queue: false});
        }, function() {
            jQuery(this).animate({width: '-=25px'}, {duration: 250, queue: false});
            jQuery(this).animate({height: '-=25px'}, {duration: 250, queue: false});
        });

        jQuery('#global-banner-cp-a4fa4c6ccba117d459b3c5ef05c6642d img').hover(function() {
            jQuery(this).animate({width: '+=25px'}, {duration: 250, queue: false});
            jQuery(this).animate({height: '+=25px'}, {duration: 250, queue: false});
        }, function() {
            jQuery(this).animate({width: '-=25px'}, {duration: 250, queue: false});
            jQuery(this).animate({height: '-=25px'}, {duration: 250, queue: false});
        });

        jQuery('#global-banner-cp-3de99313614c53ea391132eca046e29c img').hover(function() {
            jQuery(this).animate({width: '+=25px'}, {duration: 250, queue: false});
            jQuery(this).animate({height: '+=25px'}, {duration: 250, queue: false});
        }, function() {
            jQuery(this).animate({width: '-=25px'}, {duration: 250, queue: false});
            jQuery(this).animate({height: '-=25px'}, {duration: 250, queue: false});
        });
    });
</script>

jQuery(文档).ready(函数(){
jQuery(“#global-banner-cp-39c170794c8a8dfc143d053961f61ce3 img”)。悬停(函数(){
动画({width:'+=25px'},{duration:250,queue:false});
动画({height:'+=25px'},{duration:250,queue:false});
},函数(){
动画({width:'-=25px'},{duration:250,queue:false});
动画({height:'-=25px'},{duration:250,queue:false});
});
jQuery('#global-banner-cp-a4fa4c6ccba117d459b3c5ef05c6642d img')。悬停(函数(){
动画({width:'+=25px'},{duration:250,queue:false});
动画({height:'+=25px'},{duration:250,queue:false});
},函数(){
动画({width:'-=25px'},{duration:250,queue:false});
动画({height:'-=25px'},{duration:250,queue:false});
});
jQuery(“#global-banner-cp-3de99313614c53ea391132eca046e29c img”)。悬停(函数(){
动画({width:'+=25px'},{duration:250,queue:false});
动画({height:'+=25px'},{duration:250,queue:false});
},函数(){
动画({width:'-=25px'},{duration:250,queue:false});
动画({height:'-=25px'},{duration:250,queue:false});
});
});
可以在此处看到演示:

如果您缓慢地执行悬停,这可以正常工作,但如果您快速悬停或同时悬停在多个图像上,则宽度和高度会不断减小


有人能帮我确定为什么会发生这种情况吗?提前非常感谢。

试试这个!只需使用css转换即可

.image框{
宽度:300px;
溢出:隐藏;
}
.形象{
宽度:300px;
高度:200px;
背景位置:中心;
过渡:所有的1容易;
-moz转换:所有1秒轻松;
-ms转换:所有1秒轻松;
-webkit过渡:所有1s轻松;
-o-过渡:所有1容易;
} 
.图片:悬停{
转换:比例(1.5);
-moz变换:比例(1.5);
-webkit转换:比例(1.5);
-o变换:比例(1.5);
-ms变换:比例(1.5);/*IE 9*/
-ms过滤器:“progid:DXImageTransform.Microsoft.Matrix(M11=1.5,M12=0,M21=0,M22=1.5,SizingMethod='auto expand')”;/*IE8*/
过滤器:progid:DXImageTransform.Microsoft.Matrix(M11=1.5,M12=0,M21=0,M22=1.5,SizingMethod='auto expand');/*IE6和7*/
}


为什么不使用插件来获得这种效果。它很容易获得。您可以在图像中添加多个悬停。。看看吧,我从来不知道规模。这对我来说太完美了-谢谢你。