5 Useful jQuery Snippets

1. Back to Top Button $('a.top').click(function(){ $(document.body).animate({scrollTop : 0},800); return false; }); This code can be used to create a smooth, simple back to top button — a trendy and functional item to have on any website. Just make sure you use this HTML code or something similar (with the a tag having a class […]
Read the rest of this entry »

jQuery’s .click() Method

With jQuery, it’s super easy to make something happen as a result of something else being clicked using the .click() method. All you need to do is pass a function through the .click() method. The .click() method will be the trigger event (make sure you use a selector to indicate which HTML element being clicked […]
Read the rest of this entry »

5 of the Funniest jQuery Plugins

Sometimes the coolest jQuery plugins are the ones that really don’t serve a purpose at all.  1. Bacon! Bacon! (don’t forget the exclamation point!) exists literally to add strips of bacon to your webpages. If you ever feel like you might need to spice up a dull page or a boring block of text…why not […]
Read the rest of this entry »

jQuery’s .fade() Method

In jQuery, there several different methods that can be used to make an element fade in and out of view. They are: .fadeIn(), .fadeoOut(), .fadeToggle(), and .fadeTo(). .fadeIn() and .fadeOut() are pretty self explanatory. When triggered, it is used to have items either fade in or fade out, respectively. .fadeToggle() is used to toggle between […]
Read the rest of this entry »

Using jQuery’s .resize() Method

jQuery's .resize() method is a cool way to have an event triggered or have a function executed when something is resized. For the purposes of this tutorial, we're going to show you how to use the .resize() method to trigger an alert method whenever the window is resized. You might be surprised at how easy […]
Read the rest of this entry »

How to Get Cursor Coordinates Using jQuery

It's fairly easy to get the coordinates of your cursor using jQuery. While this information might not be particularly useful to a lot of developers, there are definitely occasions where the x and y coordinates of your cursor can be particularly useful. The code snippet below shows you how to find the x and y […]
Read the rest of this entry »

Responsive Menu
Add more content here...