I played a little with jQuery onmouseover function. Below is the following code: when the user makes links, he starts the headers (text) using the css field (text + background) on the background image. But there is a problem of visibility when this happens. In order for the user to see onmouseover spam headers, the user must go through the image until he finds an onmouseover trigger to see the header (text).
I want to achieve: when the user hovers over any part of the background image, he triggers all onmouseover events inside the same div. Unfortunately, I am afraid to find a solution for it.
Jquery:
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j( 'a' ).mouseout(function(){
var book_id=$j(this).parent().attr('id');
$j('#'+book_id).children('.info_span1').hide();
$j('#'+book_id).children('.info_span2').hide();
});
$j('a').mouseenter(function(){
var book_id=$j(this).parent().attr('id');
var position = $j(this).position();
$j('#'+book_id).children('.info_span1').show();$j('#'+book_id).children('.info_sp
an2').show();
$j('#'+book_id).children('.info_span1').text($j(this).data("title1"));
$j('#'+book_id).children('.info_span2').text($j(this).data("title2"));
$j('#'+book_id).children('.info_span1').css({top: $j(this).height()-6,
left:position.left, position:'absolute'});
$j('#'+book_id).children('.info_span2').css({top: $j(this).height()-6,
left:position.left+$j(this).width(), position:'absolute'});
});
});
html, jquery and css here:
jsfiddle
HERE SOLUTION: JSFIDLE