All jQuery Codes

jQuery Tip: How to get mouse cursor position

In this jQuery tip post, We will see how can we get the mouse cursor position using jQuery. Earlier I had posted about Provide highlighting effect on mouseover and mouseout, Find which mouse button clicked using jQuery and How to use hover method in jQuery. And in this post, find jQuery way to get the […]
Read the rest of this entry »

jQuery Tip – How to check if element is empty

In this post, I will show you a simple tip to check or verify that the element that you are accessing in jQuery is empty or not. jQuery provides a method to get and set html of any control. Check these articles for more details. Get HTML of any control using jQuery Set HTML of […]
Read the rest of this entry »

Detect Browsers using jQuery

jQuery provides a property to detect the browser. It works well for IE, mozilla, Safari and opera browser but it doesn't work for Google Chrome. Below jQuery code gives you an idea about $.browser property. $(document).ready(function() { if ($.browser.mozilla && $.browser.version >= "2.0" ){ alert('Mozilla above 1.9'); } if( $.browser.safari ){ alert('Safari'); } if( $.browser.opera){ […]
Read the rest of this entry »

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 »

How to highlight on mouseover using jQuery

In this post, I will show you a tip/trick to provide highlighting effect on mouseover and mouseout. For demo purpose, we will create a css class which will set the background color of element. This css class will be added to element on mouseover and it will be removed on mouseout. To achive this, we […]
Read the rest of this entry »

How to remove space from begin and end of string using jQuery trim

Below jQuery code remove spaces from begin and end of string using trim function of jQuery. $(document).ready(function(){ var strVal = " jQuery By Example "; strVal = jQuery.trim(strVal); alert(strVal); }); When you run this code, "jQuery By Example" will be displayed in alert box. trim() will remove the space from begin and end of any […]
Read the rest of this entry »

Responsive Menu
Add more content here...