HTML 5的优点拖放到jQuery UI拖放 [英] Advantages of HTML 5 Drag and Drop over jQuery UI Drag and Drop

查看:116
本文介绍了HTML 5的优点拖放到jQuery UI拖放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在撰写一个新的Web应用程序,需要对页面上的元素进行拖放操作(不是文件拖放)。

I'm writing a new web application that needs to support drag and drop operations for elements on the page (not file drag and drop).

这个答案对这个问题

html5 vs jquery拖放

建议使用Modernizr来检查浏览器是否支持HTML5拖放,并使用该支持,或者回到像jQuery UI

recommends using Modernizr to check whether the browser supports HTML5 drag and drop and either use that support or fall back to an alternative like jQuery UI.

由于它们有不同的模型,所以这意味着所有拖放代码都必须单独实现和测试(很少共享实现)。如果对HTML5拖放有显着的,对用户有影响的好处,并且如果对jQuery UI的回退会提供降级的体验,这似乎是合乎逻辑的。

Since they have quite different models, that means that all drag and drop code would have to be implemented and tested separately (very little shared implementation). It only seems logical to do that if there are significant, user-impacting benefits to HTML5 drag and drop and if the fallback to jQuery UI would provide a degraded experience.

是实现这两个变体有很大的好处吗?

Are there significant benefits to implementing both variants?

推荐答案

我猜想最终jQuery会利用内置的浏览器功能,如html 5拖放。

I would guess that eventually jQuery will take advantage of built-in browser capabilities like html 5 drag and drop.

如果不同的浏览器实现不同的... jQuery将处理它。

And if different browsers implement it differently...jQuery will deal with it.

这篇关于HTML 5的优点拖放到jQuery UI拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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