jQuery .toggle() only shows, never hides an absolute positioned div
<p><strong>Please don't forget to upvote the great answer by my eventual savior Beetroot-Beetroot!</strong></p>

<p>I've got this problem where <code>.toggle()</code> only shows on click, it never hides.</p>

<p>TL;DR: It normally looks like the screenshot below but the <code>.toggle();</code> doesn't hide when I click a <em>second</em> time.</p>

<p>The first div appears on a mouseover of the actual select box, taking any clicks it would receive on itself.</p>

<p>Normally clicking the first div which is the small div with 1px black border will show the second div, which works, and clicking again will hide it, which doesn't work.(the click event works, the toggle fails)</p>

<p><img src="http://i.stack.imgur.com/FrGgc.png" alt="screenshot"></p>

<p>Here's the html of the elements, yeah it's normally within a table cell:</p>

<pre><code>&lt;td style="vertical-align: top; text-align: left;"&gt;
&lt;select class="placeholder0" id="sortedselect0"&gt;
&lt;option selected="selected"&gt;- for - &lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; foraminated&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; foraminiferous&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; foraminous&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forbearant&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forbearing&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forbidden&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forbiddenly&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forbidding&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forblack&lt;/option&gt;
&lt;option&gt;adj. &amp;nbsp; forby&lt;/option&gt;
&lt;option&gt;AND MANY MORE OPTIONS&lt;/option&gt;
&lt;/select&gt;

&lt;div class="anti" id="anti0" style="height: 18px; width: 179px; position: absolute; top: 209px; left: 494px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: black; border-right-color: black; border-bottom-color: black; border-left-color: black; border-image: initial; background-color: transparent; display: block; "&gt;&lt;/div&gt;

&lt;div class="floats" style="display: none; position: absolute; top: 227px; left: 494px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: black; border-right-color: black; border-bottom-color: black; border-left-color: black; border-image: initial; " id="floatdiv0"&gt;&lt;img style="width: 222px; height: 342px;" alt="" src="fake_iframe.png"&gt;&lt;/div&gt;
</code></pre>

<p>Then the javascript which follows it directly</p>

<pre><code>&lt;script type="text/javascript"&gt;
//make original select box unselectable
jQuery(".placeholder0").mouseover(function() {
    var pos = jQuery(this).position();
    var width = jQuery(this).outerWidth();
    var height = jQuery(this).outerHeight();

    jQuery("#anti0").css({
        height: (height - 2) + "px",
        width: (width - 2) + "px",
        position: "absolute",
        top: pos.top + "px",
        left: pos.left + "px",
        border: 1 + "px solid black",
        z: 2,
        "background-color":"transparent"
    });
});

jQuery("#floatdiv0").unbind('click');

jQuery("#anti0").live('click', function(){

    // .position() uses position relative to the offset parent,
    // so it supports position: relative parent elements
    var pos = jQuery(this).position();

    // .outerWidth() takes into account border and padding.
    var width = jQuery(this).width();
    var height = jQuery(this).height();

//first hide any other fake selects
jQuery("div.floats").hide();
//and antiselect overlays
jQuery("div.anti").hide();

//unhide current antiselect overlay
jQuery("#anti0").show();

    //show the menu directly over the placeholder
    jQuery("#floatdiv1").css({
        position: "absolute",
        top: (pos.top + height) + "px",
        left: pos.left + "px",
        border: 1 + "px solid black",
        //padding: height + "px",
        z: 1    
    });
    jQuery("#floatdiv1").toggle();
});

//hides the menu  
jQuery("#floatdiv1").mouseleave(function() {
    jQuery("#floatdiv1").hide();
    //and unhide overlays
    jQuery("div.anti").show();
});
&lt;/script&gt;&lt;br&gt;
&lt;/td&gt;
</code></pre>

<p>I threw the .unbind in there just to try, I'm not even sure what it's for I'm afraid.</p>

<p>Same happened with live, just .click was fine.</p>

<p>//hides the menu was my old way of hiding the div window, just leaving it, which worked flawlessly.</p>

<p>I was considering resorting to</p>

<pre><code>{
    if ( showOrHide == true ) {
        jQuery('#floatdiv1').show();
    } else if ( showOrHide == false ) {
        jQuery('#floatdiv1').hide();
    }
}
</code></pre>

<p>but I tested it and it didn't work so perhaps I'm doing it wrong?</p>

<p>I wanted to add an example of the problematic code at work but somehow <a href="http://www.thehappymarquis.com/misterproblem.php" rel="nofollow">mister problem.php</a> is completely not working when I copy the code from the usual pages to this new php page.</p>

<p>Please help me just toggle this div one way or another. >.&lt;</p>
