Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EDIT: It's worth noting that the jQuery version of the below will be more compact and, in my opinion, more easily understood.</p> <p>Glo, the code you have currently would be helpful here, especially since it seems you will have difficulty changing anything we give, or implementing what we might describe. Anyway, this works as intended in IE7, Firefox, and Opera; Safari and Chrome go quirky with it: <a href="http://jsfiddle.net/bUFzq/35/" rel="nofollow">http://jsfiddle.net/bUFzq/35/</a> (modified from <a href="http://www.plus2net.com/html_tutorial/html_frmddl.php" rel="nofollow">http://www.plus2net.com/html_tutorial/html_frmddl.php</a>).</p> <p>The CSS just makes the select position-able relative to its default placement. Elements can only be positioned relative to other positioned elements. `position: relative;' leaves the element where it was until you move it, unlike absolute and fixed. It also positions relative to the edges of its nearest positioned ancestor. (The IT industry has the unfortunate convention of increasing Y downward rather than upward; just a heads up - or down.)</p> <p>element.offsetHeight is the computed height of the element - how big it appears on the screen. element.style.bottom (like its cousins top, left, and right) sets the element's offset from the corresponding edge, in the direction of the element's center. setAttribute is fairly self-explanatory; it acts as if you were actually editing the HTML. <a href="https://developer.mozilla.org/en/DOM/CSSStyleDeclaration" rel="nofollow">Most</a> properties of <a href="https://developer.mozilla.org/en/DOM/element.style" rel="nofollow">element.style</a> (that aren't on all other objects) represent and modify similarly named CSS properties. For example, element.style.backgroundColor sets the background-color property.</p> <p>addEvent is a function copied from Dustin Diaz's <a href="http://www.dustindiaz.com/rock-solid-addevent/" rel="nofollow">Rock Solid addEvent()</a> because the browsers don't agree very well on how to do events. However, I would have put his script in a separate file and mine in yet another if I weren't working within a single script area. I did the `var addEvent = init();' thing just so you wouldn't have to scroll through his source, even though it is a good example of good code.</p> <p>mouseover &amp; mouseout are the actual listeners, explicitly called using <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/function/apply" rel="nofollow">apply</a> 1) because I needed that height value for later and 2) because for some reason (at least within jsFiddle) it doesn't start out in the correct position, and only if the listeners are called in that order will it get there.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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