All jQuery Functions

How to use hover method in jQuery

In my earlier post, I have posted about how to provide highlight effect on mouseover and mouseout using jQuery events. Today, I found another solution which is easy and compact. jQuery provide hover() event which works for both the events. It works for mouseover and it also works for mouseout. Below jQuery code uses the […]
Read the rest of this entry »

width() vs css(‘width’) and height() vs css(‘height’)

jQuery provides two ways to set width and height of any element. You can set using css or you can use jQuery provided methods. If you want to set width to 100px then $('#dvText1').css('width','100px'); $('#dvText2').width(100); Then what is the difference? The difference lies in datatype. As its clear in code that with css method you […]
Read the rest of this entry »

How to Zoom an image using jQuery

You must had seen the zoom in and zoom out functionality for images on many sites. We can very easily achieve the Zoom In and Zoom Out functionality using jQuery toggle method. It is really simple. Let me first tell you the logic behind the implementation. Initially when document is ready then we will set […]
Read the rest of this entry »

jQuery Tip: How to Switch Css Class for elements

Have you ever come across a situation where you need to switch between two css classes for all the places where these classes are used? For example on click of button, you want to switch between class1 and class2. This can be easily achieved by jQuery. jQuery provides a method "switchClass" which allows you to […]
Read the rest of this entry »

How to create clone of any object using jQuery

jQuery provides clone() method which creates deep copy set of all the elements which means it will copy the child nodes also. Clone() method is the best way to duplicate content of any element. For example, I have placed a div and a button. On click of button, we will clone the div and add […]
Read the rest of this entry »

How to find index of Selected element

jQuery provides index() method to find out index of any element. index() method returns an integer value that indicates position of the element. If the element is not found then it returns -1. The index value starts from 0 which means 1st element value will be 0. See below code snippets which finds the index […]
Read the rest of this entry »

Responsive Menu
Add more content here...