[Solved]: jQuery scrollTop not working in Chrome & Safari

Sunday, February 19th, 2012

The vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very top or if the element is not scrollable, this number will be 0. If you're using jQuery's scrollTop (usually it's used to ...

WordPress: How to Add a Sticky Widget on Sidebar

Sunday, October 30th, 2011

I needed to add a fixed position widget on the side bar so that it stays at it's position no matter page scroll or not, I have searched around to find a plugin to do that but cannot find any good solution, i have achieved that by playing a bit ...

Jquery: How to Check If a Checkbox is Checked

Thursday, October 27th, 2011

If you want to validate if a checkbox is checked using jquery (javascript framework), here is the code snippet for the purpose. We'll use :checked selector for the purpose.

Javascript/Jquery: Email Address Validation Using Regexp

Saturday, October 22nd, 2011

Email address is mostly the essential form field and to make sure that user entered a valid email address you may need to validate user input before processing. To validate an email address using javascript/Jquery you may use the following code snippet, that validate in email address using regex.

Javascript: How to Find Position of a Character in a String

Tuesday, October 18th, 2011

Sometime you may need to find position of a character in a string, charAt() string method comes in for the purpose. For instance, when you execute the following code; var mystr = 'I am a test String.'; document.write(mystr.charAt(3)); // Result will be 'm'

Javascript: How to Convert String Case (Upper & Lower)

Tuesday, October 18th, 2011

If you need to convert string case in Javascript, you may use the following 2 methods as needed. toLowerCase(); toUpperCase();

Javascript: How to Get Length of a String

Monday, October 17th, 2011

To get length of a string (in characters) using Javascript we can use the length property. Below is an example of how to do it;