Version 1.4 is the latest inception of the highly popular lightweight cross browser JavaScript framework. The new version features many new additions and speed improvements over 1.3.
jQuery was developed in 2006 by John Resig and since launch has been adopted by many large companies such as Google, Microsoft, Mozilla, Digg and many more. The mantra behind jQuery is “write less, do more” With a wide range of easy DOM manipulation calls and user interface effects jQuery is an attractive option for developers looking to make applications more intuitive, user friendly and feature rich.
So whats new in 1.4?
Aside from all the new additions and improvements one of my favourite new functions is .delay(). Delay provides us with the functionality to delay execution of subsequent items in the queue.
For example we can fade out and fade in an element with a second delay.
$(‘#myelement’).fadeOut(“slow”).delay(1000).fadeIn(“slow”);
jQuery not only allows us to delay on effects we can also apply delays to custom queues.
One of many new updates is the addition to pass event data to the function .live(). This gives developers much more flexibility to capture events. From form submission, focus changes, clicks and custom events.
The example below shows how to smooth scroll on all anchor tag elements using live to capture the click event data.
// all “#anchor” smoothscroll to those elements
$(“a[href^=#][href!=#]“).live(‘click’,function(e){
$(‘html,body’).animate({‘scrollTop’: $($(this).attr(‘href’)).offset().top+’px’});
e.preventDefault();
});
According to BuiltWith.com’s statistics jQuery is running on one in five websites on the internet. Not surprising considering the adaptability of the framework.
14 days of jQuery is still running and you can find more information via the below links.
http://jquery.com/
http://jquery14.com/