0

我使用此代码来增加和减少 div 的大小:

$("#div1").hover(function() {
                var $this = $(this);
                $this.css({'z-index' : '10', 'boxShadow' : '1px 3px 6px #444', 'position': 'fixed' }).animate({
                    'height': "390",
                    'width' : "840",
                    'marginTop' : "-12",
                    'marginLeft' : "-12",


                });
            },function() {
                   var $this = $(this);
                   $this.css({'z-index' : '1', 'boxShadow' : '0px 0px 0px ', 'position': 'static' }).animate({
                    'height': "350",
                    'width' : "800",
                    'marginTop' : "0",
                    'marginLeft' : "0"
                });
            });



            $("#div2").hover(function() {
                var $this = $(this);
                 $this.css({'z-index' : '10', 'boxShadow' : '1px 3px 6px #444', 'position': 'fixed' }).animate({
                    'height': "270",
                    'width' : "290",
                    'marginTop' : "-12",
                    'marginLeft' : "-12",


                });
            },function() {
                   var $this = $(this);
                   $this.css({'z-index' : '1', 'boxShadow' : '0px 0px 0px ', 'position': 'static' }).animate({
                    'height': "250",
                    'width' : "250",
                    'marginTop' : "0",
                    'marginLeft' : "0"
                });
            }); 

为什么在 Chrome 和 Safari 上无法正常工作?

在 Firefox 中正常工作,但在 Chrome-Safari 中,当增加 div 的大小时,div 移动并且 div 移动到另一个位置。

没有控制台错误。

示例:http: //jsfiddle.net/d3athR0n/S8Nqm/3/

谢谢。

编辑:其他问题为您提供帮助:https ://stackoverflow.com/questions/17460335/slideshow-glitching-on-chrome-safari-with-jquery

4

0 回答 0