views:

490

answers:

4

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?

+19  A: 

jQuery works fine with html5.

colinmarc
Ya but does JQUERY take advantage of HTML5's better rendering capabilities via Webkit? Or will that be the job of the plugin?
AnApprentice
I don't really understand the question. jQuery is just an extension of javascript, so any speed boosts to javascript that come with the new version of webkit will be just as effective if you use jQuery.
colinmarc
colinmarc, read my answer below if you haven't already, you might then understand what he is asking.
RobertPitt
I already upvoted your answer =)
colinmarc
+6  A: 

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.

RobertPitt
Ok but JQUERY has animations like SlideDown, SlideUp etc... that aren't using HTML5 for animations right? Wouldn't HTML5 handle that more optimally?
AnApprentice
jQuery manipulates CSS for that sort of thing.
colinmarc
Slide up and SlideDown work by mathematical calculations within the javascript engine, they increase/decrease a value over a given time, so for instance a 10px box, if you wanted to expande that to 20px over the time of 1 second, that box would increase 1px every 100 milli-seconds... this is basic CSS Manipulations and has nothing to do with HTML5. Hope you can see my point.
RobertPitt
@RobertPitt - @nobosh does have a valid point here. WebKit supports CSS-only transitions. I'm not extremely familiar with them, but, depending on how feasible it is to mix them in with jQuery's existing infrastructure, it might be worthwhile to use those instead.
Matchu
Ok i get a good idea of what he is asking now, ive updated my post with a little extra information.
RobertPitt
CSS transitions and animations are not HTML no matter what number you put after it.If the question is, will JQuery eventually use hardware accelerated transitions - in all browsers and not just webkit based ones - the answer is yes.But really folks, please write this on the chalkboard 100 times "CSS 3 is not HTML5", "CSS 3 is not HTML5"... No matter how much Apple and Google tell you it is.
itpastorn
+6  A: 

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 Resign 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.

Paul D. Waite
+1 for the Babbage quote. The rest of your answer is good too, but the quote nails it :)
Neil Aitken
A: 

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/

Bakaburg