jQuery:FF 中的可调整大小问题 - 需要调试帮助

发布于 2024-10-02 15:39:26 字数 2243 浏览 0 评论 0原文

请在 Firefox 中尝试以下操作(我的版本:3.6.12)。
这曾经有效,但现在不行了。 它确实可以在 IE 中工作,并且可以在 FF 中的 jsFiddle 中工作 - 我在想插件可能会影响它。

代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <title>Test</title>
   <link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet" />
   <style type="text/css" media="all">
      .ui-resizable-e {right:0; background:#eee; z-index:1000;}
      .ui-resizable-w {left :0; background:#eee; z-index:1000;}
       #foo
           {
              background   : #fff;
              border       : 1px solid #ccc;
              margin       : 0 auto;
              padding      : 1em; 
              text-align   : left;
              width        : 75%;
           }

   </style>
   <script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script>
   <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js" type="text/javascript"></script>
   <script type="text/javascript">
      $(function(){

         var foo = $('#foo');
         foo.resizable({
              animate       : true
            , animateEasing : 'swing' 
            , handles       : 'e,w'
            , resize        : function (event,ui){
                                 ui.position.left = ui.originalPosition.left;
                                 ui.size.width    = ( ui.size.width
                                                    - ui.originalSize.width )*2
                                                    + ui.originalSize.width;
                                 }
            });
      });
   </script>
</head>
<body>
   <div id="foo"></div>
</body>
</html>

重现错误:

  1. 抓住边缘之一并调整 div 大小(拖动然后释放)。
    通常,一旦完成此操作,调整大小挂钩就应该被释放,但对我来说却没有。
  2. 取消单击夹点后,我可以单击主体中的任意位置(夹点的左侧/右侧)来调整 div 的大小。

我已经在上面添加了测试页面的完整 HTML(不长)。所有的CSS和脚本都链接到谷歌的库。

Please try the following in Firefox (my version: 3.6.12).
This was working and now it's not.
IT does work in IE and it works in jsFiddle from w/in FF - I'm thinking an addon may be affecting it.

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <title>Test</title>
   <link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet" />
   <style type="text/css" media="all">
      .ui-resizable-e {right:0; background:#eee; z-index:1000;}
      .ui-resizable-w {left :0; background:#eee; z-index:1000;}
       #foo
           {
              background   : #fff;
              border       : 1px solid #ccc;
              margin       : 0 auto;
              padding      : 1em; 
              text-align   : left;
              width        : 75%;
           }

   </style>
   <script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script>
   <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js" type="text/javascript"></script>
   <script type="text/javascript">
      $(function(){

         var foo = $('#foo');
         foo.resizable({
              animate       : true
            , animateEasing : 'swing' 
            , handles       : 'e,w'
            , resize        : function (event,ui){
                                 ui.position.left = ui.originalPosition.left;
                                 ui.size.width    = ( ui.size.width
                                                    - ui.originalSize.width )*2
                                                    + ui.originalSize.width;
                                 }
            });
      });
   </script>
</head>
<body>
   <div id="foo"></div>
</body>
</html>

To reproduce the error:

  1. Grip one of the edges and resize the div (drag then release).
    Normally once this is done, the resize hook should be released, however for me it is not.
  2. After unclicking the grip, I can click anywhere in the body (to the left/right of the grip) to resize the div.

I've included the full HTML (not lengthy) of my test page above. All the css and script is linked to google's libraries.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

海拔太高太耀眼 2024-10-09 15:39:26

我刚刚在 Firefox 3.6.12 中尝试过,一切正常 - 我可以握住、移动,当我松开时,它会调整大小。不存在您提到的“挂起版本”问题。

为什么不在安全模式(firefox --safe-mode)下启动它来测试没有插件的情况?

I just tried it in Firefox 3.6.12, all works fine - I can grip, move, when I release, it resizes. There's no "hanging release" issue that you mention.

Why don't you start it in safe mode (firefox --safe-mode) to test without addons?

下壹個目標 2024-10-09 15:39:26

我相信问题存在于 FireQuery v0.8 插件中getfirebug.com/" rel="nofollow">Firebug v1.5.4。

具体来说,我发现在控制台中关闭 jQuery Lint 不再产生上述错误。

如果您能够重现该错误,请发表评论。

I believe the problem exists in the FireQuery v0.8 add-on to Firebug v1.5.4.

Specifically, I found turning jQuery Lint off in the console no longer produced the error above.

Please comment if you are able to reproduce the error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文