Jump to content

Hover Blink


Tobm

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...