CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   JQuery Rollover Button Slow! (http://www.codingforums.com/showthread.php?t=248197)

angelali 01-07-2012 08:31 PM

JQuery Rollover Button Slow!
 
Hi, I have created a navigation menu with images. So my code is here for one button image when hover, it changes to another image:

$(document).ready (function () {
$('.button').hover (function () {
$(this).attr ('src', 'image1.jpg');}, function () {
$(this).attr ('src', 'image.jpg');
});
});


The hover works perfectly, but it is taking about 3 seconds to take effect, why?

DanInMa 01-07-2012 09:01 PM

maybes it's not caching the file. You would probably get better results by making 2 classes with the 2 images in them and then use addClass and removeClass

angelali 01-08-2012 07:52 AM

Add class to what? the image? How?


All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.