Scene Setting:
I have 2 layers one on top of the other. The bottom layer contains links (simple images). The top layer contains an extended tooltip, similar to hovering for the bottom layer. These tooltips can be large (they can easily overlap other links and almost always overlap the link they click on).
My question is:
I would like my mouseover events to appear at the lower level, and then on the mouse to display a tooltip in the upper layer. Thus, when you move from the bottom link, the tooltip in the top layer disappears, and the tooltip for the new link can be displayed.
How to take events from the top layer and pass them below the layer? So the top layer is transparent.
HTML example:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css" media="screen"><!-- .tile { width: 100px; height: 100px; position: absolute; } .tile:hover, over:hover {border: 1px solid black;} .over { width: 100px; height: 100px; position: absolute; display:none} .stack, #sandwich { width: 400px; height: 400px; position: absolute; } #tile1 {top: 50px; left: 50px;} #tile2 {top: 75px; left: 10px;} #tile3 {top: 150px; left: 310px;} #tile4 {top: 250px; left: 250px;} #tile5 {top: 150px; left: 150px;} #over1 {top: 55px; left: 55px;} #over2 {top: 80px; left: 15px;} #over3 {top: 155px; left: 315px;} #over4 {top: 255px; left: 255px;} #over5 {top: 155px; left: 155px;} --></style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script> $(document).ready(function(){ $('div.tile').click(function(){ $('#log').html(this.id + " clicked"); return false; }) $('div#top').click(function(){ $('#log').html('Top clicked'); return false; }) }); </script> </head> <body> <div id="sandwich"> <div class="stack" id="bottom"> <div class="tile" id="tile1">1</div> <div class="tile" id="tile2">2</div> <div class="tile" id="tile3">3</div> <div class="tile" id="tile4">4</div> <div class="tile" id="tile5">5</div> </div> <div class="stack" id="top"> <div class="over" id="over1">Tooltip for 1</div> <div class="over" id="over2">Tooltip for 2</div> <div class="over" id="over3">Tooltip for 3</div> <div class="over" id="over4">Tooltip for 4</div> <div class="over" id="over5">Tooltip for 5</div> </div> </div> <div id="log"> </div> </body> </html>
In the javascript example, I checked that the events worked as usual, and only the top part was pressed. But I basically want the over elements to be transparent.
javascript jquery javascript-events
silkcom
source share