|
jQuery graphic effect - hover and fading opacity |
|
|
|
|
Except the effect in previous example to zoom in and out on hovering the graphics, I have added an opacity level changed on each. Only need to add a class name imghover and add the script below.
Function: fadeTo(speed, opacity, callback) - Fades the opacity of all matched elements to a specified opacity and fires an optional call back after completion.
<script type="text/javascript">
$(function() {
$(".imghover").hover(
function() {
$(this).fadeTo("fast", 0.7);
},
function() {
$(this).fadeTo("fast", 1.0);
});
});
</script>
|