Jump to content
Sign in to follow this  
Tobm

Hover Blink

Recommended Posts

I am finishing my website but I am still encountering a final problem.

The coconut image has a background hover image when the user points the cursor over it, another image appears. Everything works fine, however, when the website is loaded for the first time, there is a fast blink before the hover image is displayed. After that, it works perfectly. How can I fix this issue?

Here is the snippet of the code.

<script type="text/javascript">
$(document).ready(function() {
$('#coconut').hover(function() {
$('body').addClass('hover');
}, function(){
$('body').removeClass('hover');
});
});
$(window).scroll(function(event) {
$("#nav").css("margin-top", 220-$(document).scrollTop());
});
</script>

Please help

my website: http://www.tasteofbrazilkc.com

Share this post


Link to post
Share on other sites

It might be an issue with loading. You can either preload the hover image, or use a sprite.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...