In an effort to move to HTML5, does one have to abandon jQuery or is a port underway to move jQuery to HTML5?
开发者_如何学编程For example, jQuery has animations like SlideDown, SlideUp etc... that aren't using HTML5 for animations? Wouldn’t HTML5 handle that more optimally?
jQuery works just fine with HTML5.
Might be time to break out the Babbage here.
I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Although your comments are helping:
Ok but JQUERY has animations like SlideDown, SlideUp etc... that aren't using HTML5 for animations right? Wouldn't HTML5 handle that more optimally?
Technically HTML5 doesn’t include any animations — they’re in CSS 3 rather than HTML5. However, some people (e.g. Apple) seem to be using the term “HTML5” as a synonym for “cool new stuff that not all browsers support yet”, and CSS Animations certainly fall into that camp.
jQuery could indeed make use of CSS animations, in browsers that support them, to speed up its animation functions like slideDown
, and might do that in a future version – jQuery’s creator John Resig discusses some possible pitfalls here: http://ejohn.org/blog/css-animations-and-javascript/
But this would be transparent to developers who use jQuery. The point of a framework like jQuery is it saves developers from worrying about browser differences. So there’s certainly no need to abandon jQuery just because there’s some new CSS stuff supported by some browsers.
Of course, if you want to write CSS 3 code instead, or write a jQuery plugin that takes advantage of it, you’re free to do so. But if the existing jQuery functions already work for you, there isn’t any point in changing to something else.
jQuery is only a manipulation engine for the DOM, the DOMS Structure is the same just with HTML5 theres extra Namespaces within the dom.. but something such as canvas
is still the same type of entity as strong
or a
so jQuery would not have any issues on HTML5 as it does on X-HTML
in regards to some CSS3 Transitions you can still perform the same stuff within jQuery yourself.
$('div.rotateable').click(function(){
$(this).css({webkitTransform:'rotate(360deg)'});
});
I can understand your prospectives in this matter but unfortunately i haven't got any idea of the benchmark comparisons for direct pixal animations VS inbuilt Webkit animations.
I think there are really good reasons for jQuery to adopt HTML5 and CSS3 features. Actually they implement a lot of functions that jQuery already implements, they do it natively. The result would be less code parsing and better resource handling. For example in javascript 1.6 there are a lot of new function for navigating and filtering arrays that are faster than the use of loops; the native drag and drop is surely faster that jQueryUI one; and better not talk about GPU driven CSS3 animations. These and a lot of other stuff are pretty worth for a rewriting of jQuery. And since as you said jquery is cross-browser, I think it would be pretty easy for them to trigger the new functions only in the right browsers, leaving the old one (yes, one) with the old implementation. I don't see the discussion, this is a no brainer problem.
http://www.html5rocks.com/tutorials/speed/quick/
What isn't being answered is whether jquery will use hardware-accelerated routines that are OS-specific; for example, iOS devices have hardware acceleration for css styles 'translate3d' which are dramatically better than using 'translate'... In fact, a slide effect using translate3d makes any other technique look like a poor hack by comparison.
精彩评论