About The Author

Sam Deering is a senior web developer who specialises in JavaScript & jQuery. Sam is the founder of the jQuery 4u Blog and you can find him these days … More about Sam

Useful jQuery Function Demos For Your Projects

Quick Summary

Every aspiring web developer should know about the power of JavaScript and how it can be used effectively to enhance the ways in which see and interact with web pages. Fortunately, to help us be more productive we can use the power of JavaScript Libraries and this article we will take a good look at jQuery in action.

Table of Contents
Membership counter

Members support Smashing

Wonderful, friendly people who keep this lil' site alive — and get smarter every day.

Are you smashing, too? →

Every aspiring Web developer should know about the power of JavaScript and how it can be used to enhance the ways in which people see and interact with Web pages. Fortunately, to help us be more productive, we can use the power of JavaScript libraries, and in this article we will take a good look at jQuery in action.

50 jQuery Function Demos for Aspiring Web Developers

#j4u-post .twittereyesclosed { background-image: url('https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/3cd9ba27-7312-4721-af8d-62c7397e548f/twitter-eyes-closed.jpg'); } #j4u-post .twittereyesopen { background-image: url('https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/662b4dd1-999d-4dda-9fcb-24966dba1abf/twitter-eyes-open.jpg'); }

#### What Is jQuery? In a nutshell, **jQuery is a leading JavaScript library** that can perform wonders on your Web pages and make your Web development life much easier and more enjoyable. With the rise in popularity of jQuery since its arrival in 2006, over an estimated 24 million websites (50% of them being the 10,000 most visited websites) currently reap the benefits, and as Google Trends suggests, it’s the most popular JavaScript library. $('#'+id+' .content2').bind('click', function(e) { e.preventDefault(); getContent('https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/b1b5b024-bcba-404b-9f8f-c4b5445ae679/content2.html'); }); $('#'+id+' .content3').bind('click', function(e) { e.preventDefault(); getContent('https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/b22837c9-c327-4ba7-8aec-af52dc068d41/content3.html'); }); function getContent(filename) { $.ajax({ url: filename, type: 'GET', dataType: 'html', beforeSend: function() { $('#'+id+' .contentarea').html(''); }, success: function(data, textStatus, xhr) { if (filename == 'https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/b22837c9-c327-4ba7-8aec-af52dc068d41/content3.html') { setTimeout( function() { $('#'+id+' .contentarea').html(data); }, 2000); } else { $('#'+id+' .contentarea').html(data); } }, error: function(xhr, textStatus, errorThrown) { $('#'+id+' .contentarea').html(textStatus); } }); } }, reset: function(id) { $('#'+id+' .contentarea').html('Content will appear here.'); $('#'+id).hide(); } }, "getJSON": { run: function(id) { $.getJSON('/wp-content/uploads/2011/11/colors.json', function(data) { var options = $('#'+id+' select'); $('#'+id+' select').append('

(al) (km)