jqDnR plugin doesn't work with jQuery 1.4

↘锁芯ラ 提交于 2019-12-07 09:25:12

问题


I am using jqModal plugin which relies on jqDnR for drag and resize support. After I upgraded jQuery to 1.4, modal boxes stopped responding to "drag" event. Does anyone know why this is happening?

Thanks..


回答1:


Using the version downloaded directly from the author's website (here), on lines

19, character 38

and

27, character 23.

Replace

$()

with

$(document)

That's how I got jqDnR to work with 1.4




回答2:


see the jQuery 1.4 release announcement - Backwards-Incompatible Changes.

We’ve also written a plugin that provides backwards compatibility with every potentially-breaking change that we’ve made in 1.4. Feel free to download and include this plugin, after you’ve included 1.4, if you have any issues upgrading to 1.4.

How to use the plugin:

<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://code.jquery.com/jquery.compat-1.3.js"></script>

include it, or wait for new, 1.4 compatible version of plugin you're using.




回答3:


I was using the jqDnR, jqModal and jQuery for several months and had issues with dragging failing in Safari/Chrome or getting stuck in Firefox. I recommend switching to JQuery UI Draggable...

http://jqueryui.com/demos/draggable/

I think many of the features that were originally in jqDnR/jqModal have been moved to ui-draggable. The switch wasn't too tough. The only drawback (which is also in jqDnR) is when using an iframe in the draggable container. If the mouse moves too fast into the area of the iframe from the drag handle (or draggable area containing the iframe), the iframe appears to pick up the mouse action and the drag gets hung until you re-enter the draggable area. A bit of a hack is required for that...

Trouble Using JQuery UI.Resizable() and UI.Draggable() with an iFrame

After putting the hack above, performance is better.



来源:https://stackoverflow.com/questions/2108078/jqdnr-plugin-doesnt-work-with-jquery-1-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!