Firstly I have to say I have no coding experience whatsoever, but will try to explain what I am trying to acheive.
I have the following code with 2 images… blue.png is a color image
bluebw.png is the same image in black and white. Code simply changes images on mouse over.
<script type='text/javascript'>
$(document).ready(function(){
$(".blue").hover(function() {
$(this).attr("src","files/blue.png");
}, function() {
$(this).attr("src","files/bluebw.png");
});
});
</script>
<a href="page-1.html">
<img src="files/bluebw.png" alt="dresses" class="blue" height="300" width="170" />
What I would like to do is the following:
-
add the option for fade in/out on mouseover of the 2 images (fast/slow/or none)
-
add display text on mouse over with fade in/out on mouseover (fast/slow/or none) after the image fade, format text (font/alignment/top bottom center/background/opacity)
I’m really flying in the dark here 🙂 Any help would be immensely appreciated.
Cheers
Try this:
Suppose you have an HTML structure like this:
and css :
jQuery code:
Here is a fiddle for demo
Or you can use css3 transition:
Here is a fiddle using css3 and jQuery.hover as fallback for ie