I’m currently learning jQuery with the help of the new book from Sitepoint novice to ninja. I’m loving the book so far and it’s definitely helping me understand the world of jQuery but as a complete noob to this library I’m finding the the book is skipping over some of the basics.
For example I have just started to animate a nice navigation menu using CSS Properties, the book uses this code
$(‘#navigation li’).hover(function(){
$(this).animate({paddingLeft: ‘+=15px’}, 200);}, function() {
$(this).animate({paddingLeft: ‘-=15px’}, 200);
});
Which is great I type it in and the animation works without a hitch but my issue is that they don’t explain how the hover function works. Sure I can read the code above and understand it to a degree but it wasn’t till I installed the jQuery sugar plugin which autofills some of the code that I really understood what was going on. if I type $(this).hover into Espresso with sugar installed these options appear.
$(this).hover(over, out)
Ok, so now I can make sense of the above, the first statement is for hover over and the second is for hover out. Shouldn’t things like this be covered in the book? Don’t get me wrong the book is a great way to start learning and using jQuery I’m only 80 pages in and have definitely developed a deeper understanding for the library, I’m just struggling a little with how to layout my code.
So to anyone that it currently trying to learn jQuery with this book I would recommend installing jQuery.sugar for Espresso or another sort of autofill plugin, it’s helped heaps.
Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010