Image On-state problem

Permalink
Hi, then I add an image On-State, the onmouseover and onmouseout effect have a delay, normaly the image should swap right away then the mouse is over the image, but for some reason I have a delay on about 1 second, that don't happend if I make the same function in the text editor.

Why is that, and does anybody have the same problem?

Thanks

 
BigBobbyD replied on at Permalink Reply
BigBobbyD
Are you using the image block?
mikkelwh replied on at Permalink Reply
Yes
BigBobbyD replied on at Permalink Reply
BigBobbyD
There's nothing in the image block to pre-load the image to be swapped.

This can easily be accomplished by attaching an empty div that uses the swapped image as a background. This way the browser will load the swap image when it loads the page and the swap should be instantaneous.

If you add something like the following between lines 95 & 96 of the image block's controller.php and save the new file to /blocks/image/controller.php, it should do the trick:

$img .= '<div style="display:none; background-image:url(' . $relPathHover . ')></div>';
mikkelwh replied on at Permalink Reply
@BigBobbyD

Thanks a lot, but I found out that it was Chrome that cause the problem, after 4 hours frustration, I tried it in IE and FireFox, and there was no problem.
Have no idea why, I tried to clean the memory in Chrome, and still have the problem most of the time, I guess concrete5 and Chrome don't work very well together.
BigBobbyD replied on at Permalink Reply
BigBobbyD
Oh, ok...

I guess maybe I misspoke (mistyped) about there not being anything in the block to preload. I actually didn't check the javascript. I prefer the css approach to preloading with javascript anyway, I guess, non-semantic html aside.

About chrome... I've noticed the cache can, on occasion, seem stuck or something. Have you restarted the whole kibble? Sorry if that's a too-obvious suggestion!
mikkelwh replied on at Permalink Reply
Any suggestions are welcome :)

Yes, I tried, but it didn't make any different.