All jQuery Tips

jQuery .end() and Chaining

Before you go further, I assume that you know What is chaining in context of jQuery? If not, then first read "What is Chaining in jQuery?". To summarize Chaining in jQuery means to connect multiple functions, events on selectors. Main advantage of using chaining is that it makes code look clean and gives better performance. […]
Read the rest of this entry »

Scroll Page Automatically by few pixels after every few seconds using jQuery

It would be nice feature for web pages if the web page scrolls automatically by few pixels after every 2, 3 or 5 seconds so that the users don't have to scroll it. This is quite useful for webpages having articles, posts, very long text or lengthy pages. So, In this post you will find […]
Read the rest of this entry »

Direct vs Delegated Events with jQuery on() method

jQuery added a new method called  on()  in release 1.7 which provides all functionality for attaching event handlers. And it has made other event handler event like live() and delegate() dead. This method was introduced due to performance issue with live() method. Related Post: jQuery Name-spacing with on() and off() method empty() vs remove() vs […]
Read the rest of this entry »

Delay jQuery animation by few seconds

I got into a situation where I needed to start the animation after 2 seconds once the mouse is on the image. In other words, need to delay the animation for 2 seconds on mouseover event. So in this post I am sharing the jQuery solution to delay the animation by few seconds. Related Post: […]
Read the rest of this entry »

Difference between $(‘div’) and $(‘

One of my colleague who is learning jQuery asked me what is the difference between $('div') and $('<div/>') , if used as selector. To explain more, take a look at below code. $('<div/>').addClass('test'); $('div').addClass('test'); It is indeed quite confusing for someone who just started learning jQuery. So I went ahead and explained him about how […]
Read the rest of this entry »
‘) in jQuery

jQuery: Difference between eq() and get()

In this post, find out what is the difference between jQuery  eq() and  get() method. Both the methods are used to find and select single element from set of elements and they both return single "element". And they both accept single int type parameter, which denotes index. Related Post: Difference between $(this) and 'this' in […]

Responsive Menu
Add more content here...