jquery - Manage Click events through overlapping items -
i got javascript overlapping problem in slideshow component. want add icon delete picture in slideshow, icon on right top corner of each picture.
the problem : icon (and click event) under big blank div (in blue on screenshot). div used go next picture.
is there solution fire icon event & block slideshow event?
here clean code
<html> <head> <style> #slideshowcontroller1 { position: absolute; left: 50%; top: 0; width: 50%; height: 100%; z-index: 98; border: 1px solid blue; } #slideshowcontroller2 { position: absolute; left: 0; top: 0; width: 50%; height: 100%; z-index: 98; border: 1px solid green; } #pic1 { height: 400px; width: 400px; border: 1px solid red; } #delete1 { float: right; width: 24px; height: 24px; margin-top: 0px; background-color: black; } .swipe { overflow: hidden; visibility: hidden; position: relative; width: 100%; max-width: 500px; margin: 0 auto; text-align: center; } .swipe-wrap { overflow: hidden; position: relative; } #slideshow { position: relative; overflow: hidden; margin-top: 20px; } </style> </head> <body> <div id="slideshow"> <div id="slideshowcontroller1" class="slideshowcontroller" onclick="alert('right');"> </div> <div id="slideshowcontroller2" class="slideshowcontroller" onclick="alert('left');"> </div> <div id="myswipe" class="swipe" style="visibility: visible;"> <div class="swipe-wrap" id="swipe-gallery" style="width: 2500px;"> <div id="pic1"> <div id="delete1" class="thumbdelete" style="z-index: 100;" onclick="alert('delete');"> <img src="../../img/delete.png" width="100%"> </div> </div> </div> </div> </div> </div> </body> </html>
if put z-index:100 on myswipe, it's work out side of picture... partial solution !
but not desired operation, icon must over...
any ideas ?
Comments
Post a Comment