background preloader

jQuery

Facebook Twitter

Top 10 tips to improve your jQuery usage | jTutorials. Stupid jQuery Tricks. If you are like I am and use jQuery to add functionality or enhance your site, you're almost always looking to learn something new or different ways to add a cool new function using the most popular JavaScript library out there. While none of these functions are actually stupid, they will show you some popular tricks to add effects and features to your site.

Disappearing Search Box Text Every site has one, a search box. Some do it right and others don't, nothing ruins usability more than clicking in a search box and having to press the delete key to remove the default search text then type before being sent on your way. Here is a simple function to gray out the text, remove it when the user clicks and then put it back when they are done. Disappearing search text on Smashing Magazine The Code The Inputs Give It A Try Disappearing Search Box Text on Multiple inputs Reader Brain commented and wanted to know how to do this with multiple inputs. The inputs Smooth Page Scroll The Links top of post. jQuery Code Snippets for Visual Studio 2010. Plugins.

Wkrte - Project Hosting on Google Code. I wanted a lightweight, clean and sleek Rich Text Editor to use in my projects. If you download this jQuery plugin be aware this is an early alpha version and there are still many bugs to be fixed: Anyone is welcome to join and contribute to this project. Screenshot - rich html enabled Screenshot - rich html disabled. jQuery UI FlipBook. 10 jQuery snippets for efficient developers. Load jQuery from Google Google has a fresh version of jQuery, which is made available for developers.

Instead of getting a jQuery copy, you should definitely take advantage of Google’s “generosity” and directly load their copy: » Source Validate a date of birth using jQuery Validating dates of birth are a common task on websites that have content available only for users 18+ years old. $("#lda-form").submit(function(){ var day = $("#day").val(); var month = $("#month").val(); var year = $("#year").val(); var age = 18; var mydate = new Date(); mydate.setFullYear(year, month-1, day); var currdate = new Date(); currdate.setFullYear(currdate.getFullYear() - age); if ((currdate - mydate) < 0){ alert("Sorry, only persons over the age of " + age + " may enter this site"); return false; } return true; }); » Source Make sure an image has loaded properly How do you know if an image has been properly loaded?

$('#myImage').attr('src', 'image.jpg').load(function() { alert('Image Loaded'); }); » Source.