It appears that the link provided initiates a hover state for the background image followed by displaying a tooltip using a timeOut function. I am currently creating a fiddle to demonstrate this process clearly.
So, without further ado, here is the Fiddle!
The key aspect lies in the jQuery script which incorporates both a delay function and defines the hover state of the image within the CSS code. As a user hovers over the image, an alternate image is displayed initially, achieved through simple CSS hover techniques and the use of CSS sprites.
.item {
background-color: white;
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-position: center top;
}
.item:hover {
background-repeat: no-repeat;
background-position: center bottom;
}
#flower {
background-image: url('http://bramvanroy.be/files/images/tooltipOverlay.jpg');
}
Upon hovering over the image at the outset, a jQuery function is activated with a set delay:
var tooltip = $(".item-tooltip");
tooltip.hide();
$(".item-wrapper").hover(
function() {
$(this).children(tooltip).delay(550).fadeIn("slow");
$(this).children(".item").fadeOut("slow");
},
...
Exiting the tooltip area triggers its concealment and reveals the original .item
image again:
...
function(){
$(this).children(tooltip).fadeOut("fast");
$(this).children(".item").fadeIn("fast");
}
);
- Further information on jQuery's .delay()
- Additional insights into CSS sprites
- Image copyright details
ENHANCED RESPONSE:
Presenting a Demo, showcasing the interactive tool, along with another demonstrating the static nature of the image (as requested).
To augment user experience, I implemented the jQuery plugin hoverIntent making sure tooltips are not triggered for unintended quick hovers. This evaluates the user's intent before executing the function after a brief delay. More details about this plugin can be found here. While the standard jQuery hover() method could have been used, it is not recommended.
In addition, adjustments were made to the z-index to prevent overlap issues between the image and the tooltip from different items.
If you have any further inquiries, feel free to ask in the comments section.