HomeBlogJavaScript Hover Effects to Speed Up Page Load Time

Delay Loading Resources Until the User Mouses Over Them

Published July 1, 2011

 If you have a big home page with a lot of articles that have third party elements, such as Facebook Like buttons, or other JavaScript powered share buttons, you can greatly speed up the loading of your page by not loading the extras until the user's mouse cursor travels over them. An example of this is TechCrunch's home page. At first you'll see Facebook Like, Tweet, +1, and inShare buttons  on each post, but it is actually just a fake image representing the actual buttons. When you hover your mouse over it, the JavaScripts will load in and process, making the buttons come to life. 

Example:

Before mouse over:

 

After mouse over:

 

The same style effect can be used to delay image loading, such as avatar images in comments or bulletin boards. While you're at it, use Google Page Speed Tool to find more speed tips.

blog comments powered by Disqus

1 COMMENT

Michael Butler

Michael Butler

Michael joined the RustyBrick team in 2008 to focus on transitioning existing web sites to new & enhanced platforms. He graduated from Rutgers University in 2005 and holds a B.S. in Computer Science.

This article is under PHP Programming, Web Programming

There is 1 comment for this post

Connect With Us

Send Us a Message

Do you wish to give us feedback on one of our apps, send us a message or explore a proposal? Fill out the form below and we'll get back to you pronto!

Visit Us

250 West Nyack Road, Suite #200 West Nyack, NY 10994
Get Directions

Call Us Toll Free

877-GO-RUSTY
877-467-8789

Telephone

845-369-6869

Fax

845-228-8177