Results 1 to 3 of 3

Thread: explanation about anylink drop down menu scripts

  1. #1
    Join Date
    Mar 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default explanation about anylink drop down menu scripts

    I have read the scripts,but have had some questions:
    (1) It is difficult for me to understand the menu's positioning.
    (2) What role does the function dynamichide(e) play in the scripts?
    (3) What role does role the expression "document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')" play?

    Can you help me?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    document.write WRITES... prints, types, outputs, whatever, that stuff in the parentheses onto the page.

    don't know too much more about JS myself... but it'll help to link to the (or one example) script you're talking about.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are at least three variations on anylink, each may have peculiarities of positioning but, the original tends to be the simplest acting, for the most part, like one huge element, like an image or a division.

    If memory serves dynamichide(e) sets in motion the closing (hiding) of drop downs in such a manner so as to be interrupted if the mouse pointer subsequently travels over either the drop down itself or back over its trigger.

    Member djr33 got the part about document.write pretty well. To be a bit more specific, it writes the designated HTML to the page at the spot in the flow of the page that, according to the script, it logically falls. Usually, this is where the script is. The primary difference between document.write and simply hard coding normal HTML into the page is that one can include variables that get resolved to their set values as the code is parsed (read) by the browser. It should be noted that document.write executes as the page is loading, just like normal HTML but, if one tries to execute it after the page has loaded, it will overwrite (replace) the entire page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •