Archive for October, 2016

Using Method Chaining in jQuery

When you use method chaining in jQuery, it ensures that you never have to use the same selector more than once. Over-using a selector can seriously slow down your code, as every time you call on a selector you're forcing the browser to go looking for it. By combining or "chaining" multiple methods, you can […]
Read the rest of this entry »

Disable Links with jQuery

jQuery's built in preventDefault() method is a great way to prevent the default functionality of an element from occurring. It's probably most commonly used to disable links. Maybe you want a certain link only to work under certain conditions (like for example, you only want it clicked if the user is on a desktop sized […]
Read the rest of this entry »

Quick Tip: How to Load jQuery Conditionally

Many developers like to link to an externally hosted jQuery library, like for example Google's jQuery library (http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js), but the problem with linking to an external jQuery library is that they can be a bit unreliable. If for some reason there are any issues with the server, the script may not be able to be […]
Read the rest of this entry »

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 »

Responsive Menu
Add more content here...