All jQuery Codes

How to reload iFrame using jQuery

Simple but useful jQuery code snippets to reload an iFrame or reload all the iframes using jQuery. //reload 1 iframe $('#iframe')[0].contentWindow.location.reload(true); //reload all iFrames $('iframe').each(function() { this.contentWindow.location.reload(true); }); //Another way to reload all iFrames $('iframe').attr('src', $('iframe').attr('src')); Feel free to contact me for any help related to jQuery, I will gladly help you.
Read the rest of this entry »

Expand textbox on focus using jQuery

Here is jQuery code to expand the textbox onfocus using jQuery. Below code animate and expand the width of a TextBox when it receives focus. $(document).ready(function() { $('#txtSearch').width(150); $('#txtSearch').focus(function() { $(this).animate({ width: 250 }) }); $('#txtSearch').blur(function() { $(this).animate({ width: 150 }) }); });? See result below. See Complete Code Feel free to contact me for […]
Read the rest of this entry »

Copy text from one textbox to another textbox while typing

You may have seen on websites when as you type in one textbox, the same text gets copied to another textbox. In this short post, you will learn how can you implement the same functionality using jQuery. All one need to do is to bind keyup event on textbox and then copy textbox value to […]
Read the rest of this entry »

Find Scroll Height for elements using jQuery

.Height() method in jQuery returns height of the element but assume an element which has "overflow:auto" property set (you will find scroll bars) and its content are going beyond to the initially defined height. So in such case, jQuery .Height() method will not give you the scroll height. One need to use scrollHeight property to […]
Read the rest of this entry »

Find Screen Coordinates of Mouse using jQuery

In this post, you will see how to find the screen coordinates of the location where mouse button is pressed or suppose there is an image on your web page and you want to display the screen coordinates of the location where the mouse button is pressed on the image. To find out screen coordinates, […]
Read the rest of this entry »

How to disable/enable an element with jQuery

You must have come across a situation where you have to make any element disable or enable. With jQuery, there are couple of ways using them you can enable/disable any element. jQuery really makes your task very easy. In below given example, I have disabled a textbox with id "txtName". Approach 1 $("#txtName").attr("disabled", true); Approach […]
Read the rest of this entry »

Responsive Menu
Add more content here...