HTML 5 拖放相对于 jQuery UI 拖放的优势

Advantages of HTML 5 Drag and Drop over jQuery UI Drag and Drop(HTML 5 拖放相对于 jQuery UI 拖放的优势)
本文介绍了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 拖放的优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
Safari 5.1 breaks CSS table cell spacing(Safari 5.1 打破 CSS 表格单元格间距)
Put in bold part of description in metatag Drupal module(将描述的粗体部分放在元标记 Drupal 模块中)
Is it possible to compile Coffeescript code in script tags in html files?(是否可以在 html 文件的脚本标签中编译 Coffeescript 代码?)