开发者

Sprite background image lags on mouse hover

开发者 https://www.devze.com 2023-01-01 08:33 出处:网络
I have basic DOM menu that has sprite background images for the first level of \"LI\"s. It works just fine, but I 开发者_运维百科guess there is some problem and instead of switching the image right aw

I have basic DOM menu that has sprite background images for the first level of "LI"s. It works just fine, but I 开发者_运维百科guess there is some problem and instead of switching the image right away on hover it goes blank and after about a second the hover image "appears" (shifts).

That happens only on first hovering. After that it's smooth like it's supposed to be. Refresh the page and there it is again... Frustrating... Here is a link to check it out: http://goo.gl/6FAM

The problem exist on Firefox v3.6.3. Chrome 5.0.375 and IE 8.0.7600 don't have this issue.

Any ideas?


It's because the hover background image is not loaded until you pass the mouse on the button.

An easy solution is to use CSS sprites, so you will only have 1 image to deal with.

0

精彩评论

暂无评论...
验证码 换一张
取 消