Beginner

jQuery Prefixes: jQuery vs. $

It's a really common practice in jQuery to use the dollar sign ($) prefix with your methods, like this: $(document).ready(function(){ $(#myDiv).slideUp(); }) The above code would make the div with the ID #myDiv slide up when the page loads. But that's not the only way to write that function. Sometimes you might see it written […]
Read the rest of this entry »

How to Disable Right Click Using jQuery

There are many reasons a developer may want to disable right-click on their websites. While it's not always considered a best practice, it's definitely doable and can actually be achieved quite easily. With jQuery it's really simple to disable right-click on your site. All you need to do is add this snippet to your scripts: […]
Read the rest of this entry »

Using jQuery to Dynamically Add CSS to HTML

jQuery easily allows for CSS to be dynamically changed as a result of different event triggers. This is especially useful if you want to change some styling of a particular element after a click. Implementing this type of code is fairly simple. The code in the following example would change the color of the text […]
Read the rest of this entry »

How to Validate Forms Using jQuery

Writing your own form validation code doesn't have to be a scary or time-consuming process. jQuery's Validation Plugin makes form validation easy and straightforward. To get started, all you need to do is link to the plugin files (files are also available for download if you'd prefer to host them locally) along with your standard […]
Read the rest of this entry »

Using jQuery’s Data APIs

In the beginning (well, beginning with jQuery 1.2.3 in early 2008) there was the jQuery.data() API. It offers a way to associate JavaScript data — strings, numbers, or any object — with a DOM element. As long as you manipulate the DOM element with jQuery, the library ensures that when the DOM element goes away, […]
Read the rest of this entry »

Accessible Showing and Hiding

Editor's Note: When I started this blog nearly three years ago, one of the first things I did was write a series on showing and hiding elements on a page. The posts were very basic, as was my knowledge at the time. At best, they demonstrated an incomplete answer to the question of how to […]
Read the rest of this entry »

Responsive Menu
Add more content here...