JQuery tutorials / books that teach you how to write code like this

If I see a cool effect on a website, I look at the jquery source and usually can wrap it around myself, however, I looked at the slider for http://www.mckinsey.com and look at the jQuery source that is used to execute the page slide: http://www.mckinsey.com/assets/dotcom/js/home.js

I can’t understand how this jQuery code is written or what it does, although I understand that it is written better and can be supported properly, since everything is not inside the document.ready()/ p> function

  • Maybe someone will break this code a bit to explain (I'm just interested in the slider, not the cookies).

  • Are there any tutorials / books that show how to write / understand jQuery code written this way.

+3
source share
1 answer

This method and others like it are known as "design patterns." This particular one looks like a command template. The following link has a great explanation of more popular patterns, why they are useful, and code examples:

http://addyosmani.com/resources/essentialjsdesignpatterns/book/

+1
source

All Articles