Results 1 to 2 of 2

Thread: Identify a frame as element

  1. #1
    Join Date
    Nov 2006
    Location
    Whitehorse, Yukon
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Identify a frame as element

    1) Script Title: Drop Down Tab Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...roptabmenu.htm

    3) Describe problem: This script will identify an element like a form and hide it when it drops down. There is a place to identify the element in the script and then you name the element to match.

    I would like to use this script on a header frame and have it target the main frame, but will need it to hide the lower frame. Is there a way to identify the lower frame as an element so this script can drop down over it?

  2. #2
    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

    A frame may be identified as an element by id or name and accessed to change its visibility style property in FF and in IE (version 7 tested) but, will not work in Opera and perhaps others. Given a frame like so on the parent page:

    HTML Code:
    <frame name="myframe" src="whatever.htm" />
    It's element object can be accessed like so:

    Code:
    parent.document.getElementsByName('myframe')[0]
    for visibility (to hide):

    Code:
    parent.document.getElementsByName('myframe')[0].style.visibility='hidden';
    to reveal:

    Code:
    parent.document.getElementsByName('myframe')[0].style.visibility='';
    This still may not allow anything to 'drop over' it though. There are menus that can drop across frames, I still haven't figured out how those work exactly, though I have a rough idea. Perhaps you should look into one of those. Here's one:

    http://www.dynamicdrive.com/dynamici...menu/index.htm
    - 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
  •