Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with .click function in IE with z-index
    primarykey
    data
    text
    <p>I've created a tab style menu for my website. The menu includes a bunch of images placed in an absolute position, with different z-index's. The tabs are placed under the main image, so I used the webkit rule pointer-events: none;, which works great in firefox and chrome, but not in IE. So for IE, I'm creating a top level div overlay for each tab so I can control clicks and rollovers via these div's.</p> <p>The issue is that, for some reason I cannot seem to get the .click() function to work, even when the div is on top of everything. I've tested it with .hover, and that works just fine. The only time I can get .click() to work is when I bring the lower tab layer, up to the top (which has nothing to do with the hover layers). Here is my code:</p> <p>HTML:</p> <pre><code>&lt;div id="hover-home"&gt;&lt;/div&gt; &lt;div id="hover-ss"&gt;&lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>#hover-home { height: 26.5px; width: 91px; position: absolute; top: 109px; left: 325px; z-index: 100000; border: 1px solid black; } #hover-ss { height: 26.5px; width: 124px; position: absolute; top: 50px; left: 419px; z-index: 100001; border: 1px solid black; } </code></pre> <p>jQuery:</p> <pre><code>$( document ).ready(function() { $("#hover-home").click(function(){ alert("Works!"); }); $("#hover-ss").click(function(){ alert("Works!"); }); }); </code></pre> <p>Underlying Tabs HTML:</p> <pre><code> &lt;div id="btn-index" class="&lt;? echo $tab_home; ?&gt; tab menu_link" style="height: 26.5px; width: 75px; z-index: &lt;? echo $zi_home; ?&gt;; position: absolute; top: 109px; left: 325px;"&gt; &lt;a href = "index.php"&gt;Home&lt;/a&gt; &lt;/div&gt; &lt;div id="btn-ss" class="&lt;? echo $tab_ss; ?&gt; tab menu_link" style="height: 26.5px; width: 108px; z-index: &lt;? echo $zi_ss; ?&gt;; position: absolute; top: 109px; left: 419px;"&gt; &lt;a href = "screenshots.php"&gt;Screen Shots&lt;/a&gt; &lt;/div&gt; </code></pre> <p>I've tried to use .on('click', function ({, but didn't have any success with that either. Has anyone else ran into this issue?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload