jQuery ui对话框拖动问题 [英] jQuery ui dialog dragging issues

查看:108
本文介绍了jQuery ui对话框拖动问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我们的一种产品使用了jQuery ui(jquery-ui-1.10.3)对话框插件,发现了一个可能的问题": 当托管页面很小或托管页面的当前视图滚动到顶部时,拖动打开的对话框的行为将与预期的一样.当在大页面中承载对话框时,该问题开始显现,该大页面滚动到不在顶部的某个位置,在这种情况下,对话框在拖动过程中开始跳来跳去. IE 9和最新的Firefox(21.0)均会发生这种情况.

I used the jQuery ui (jquery-ui-1.10.3) dialog pluggin for one of our products, and found a possible "problem": When the hosting page is small or the current view of the hosting page is scrolled to the top, dragging an openned dialog box behaves as what is expected. The problem start to manifest when hosting a dialog in a large page which is scrolled to somewhere not at the top, in which case the dialog box starts to jump around during dragging. It happens to both IE 9 and the latest Firefox (21.0).

页面是动态生成的,非常复杂,而且必须很长.我对小提琴并不熟悉,但是似乎没有可供我使用的jQuery-ui lib选项.

The page is dynamically generaed, complex and has to be long. I am not familiar with fiddle, but it seems to have no option for jQuery-ui lib option that I can use.

更具体地说,我发现是否将托管页面向下倾斜100px(因此,托管页面的顶部100px是馈送"到浏览器窗口的顶部边框中),然后当我拖动对话框时,而不是跟随对话框时鼠标,它会向下跳100像素,因此不会被鼠标捕获.

More specifically, I found if I scoll the hosting page 100px down (so the top 100px of the hosting page is 'feed' into the top border of the browser window) then when I drag the dialog, instead of it following the mouse, it jumps down 100px so that it is out of the mouse capture.

对话框初始化为


$(element).dialog({ 
    autoOpen: false, width: 950, height: 820, 
    modal: false, resizable: true, draggable: true
});

我的问题是:1)是否还有其他人遇到相同的问题? 2)如果是这样,这是设置问题还是错误.

My questiong is: 1) does any one else has the same issue? 2) If so, is this an setting issue or a bug.

这里的任何专家都可以帮助我吗?

Any expert here can help me with it?

推荐答案

我曾经遇到过同样的问题,页面上的内容是自动生成的.很长.

I used to have the same issue, content on the page is generated automatically. It is very long.

html, body {position: relative}解决了这个问题.

这篇关于jQuery ui对话框拖动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆