$(document).ready(function(){ jQuery.preloadimages = function() { for(var i = 0; i").attr("src", arguments[i]); } } $.preloadimages("/kids/images/nav-chris-over.gif", "/kids/images/nav-books-over.gif", "/kids/images/nav-events-over.gif", "/kids/images/nav-contact-over.gif", "/kids/images/nav-school-visits-over.gif", "/kids/images/nav-follow-over.gif", "/kids/images/nav-plays-over.gif", "/kids/images/nav-media-over.gif", "/kids/images/hop-to-adults-over.png", "/kids/images/nav-right-1-over.gif", "/kids/images/nav-right-2-over.gif", "/kids/images/nav-right-3-over.gif", "/kids/images/nav-right-4-over.gif", "/kids/images/nav-right-5-over.gif", "/kids/images/nav-right-6-over.gif", "/kids/images/nav-right-7-over.gif", "/kids/images/nav-right-8-over.gif", "/kids/images/nav-right-9-over.gif", "/kids/images/nav-right-10-over.gif", "/kids/images/nav-swap-chris.gif", "/kids/images/nav-swap-books.gif", "/kids/images/nav-swap-events.gif", "/kids/images/nav-swap-contact.gif", "/kids/images/nav-swap-school-visits.gif", "/kids/images/nav-swap-follow.gif", "/kids/images/nav-swap-plays.gif", "/kids/images/nav-swap-media.gif", "/adults/images/facebook-over.gif", "/adults/images/twitter-over.gif", "/adults/images/email-over.gif", "/adults/images/sinstagram-over.gif"); $(".hoverswap").hover( function () { $(this).attr("src", $(this).attr("src").replace(/.gif/, "-over.gif")); }, function () { $(this).attr("src", $(this).attr("src").replace(/-over.gif/, ".gif")); } ); $(".hoverswappng").hover( function () { $(this).attr("src", $(this).attr("src").replace(/.png/, "-over.png")); }, function () { $(this).attr("src", $(this).attr("src").replace(/-over.png/, ".png")); } ); $('#chris').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-chris.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#books').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-books.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#events').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-events.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#school-visits').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#follow').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-follow.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#plays').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-plays.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#media').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-media.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); $('#contact').hover(function() { $('#swap').attr("src","/kids/images/nav-swap-contact.gif"); }, function() { $('#swap').attr("src","/kids/images/nav-swap-school-visits.gif"); }); });