Professional Web Applications Themes

show hide layer function - Macromedia Dreamweaver

When someone gets a url i want to show a layer I like to show images , steak, tomatoe and shark Now here is something i copied from devshed and it ays its a function getur how would i write this? What would i write in the body script I spent so much time trying to find out. This time i got the script and i am halfway there No such thing as 'doent.getLayerById'....unless you created a new method. getURL ("JavaScript :vislayeron('myLayer')")???I don't understand this. Could someone write the entire script and script in the body that i need?short and ...

  1. #1

    Default show hide layer function

    When someone gets a url i want to show a layer

    I like to show images , steak, tomatoe and shark

    Now here is something i copied from devshed
    and it ays its a function getur
    how would i write this?

    What would i write in the body script
    I spent so much time trying to find out. This time i got the script and i am halfway there

    No such thing as 'doent.getLayerById'....unless you created a new method.

    getURL ("JavaScript:vislayeron('myLayer')")???I don't understand this. Could someone write the entire script and script in the body that i need?short and fat.

    function getElement(id) {
    return doent.all ? doent.all(id) :
    doent.getElementById ? doent.getElementById(id) :
    doent.layers ? doent.layers[id] : null;
    }

    function vislayeron(id) {
    var el = getElement(id);
    if (!el) return;
    if (el.style) el.style.visibility = 'visible';
    else if (el.visibility) el.visibility = 'show';
    }

    function vislayeroff(id) {
    var el = getElement(id);
    if (!el) return;
    if (el.style) el.style.visibility = 'hidden';
    else if (el.visibility) el.visibility = 'hide';
    }


    Last edited by mrrichardfeder on March 26th, 2002 at 07:44 PM

    Report this post to a moderator | IP: Logged

    March 26th, 2002 07:34 PM



    degsy
    Senior Member

    Registered: Nov 2001
    Location:
    Posts: 657
    oops, just a typo.

    doent.getLayerById('divname').style.visibility
    should be
    doent.getElementById('divname').style.visibilit y



    Report this post to a moderator | IP: Logged

    March 26th, 2002 07:43 PM



    CODE-Gobbler
    Junior Member

    Registered: Mar 2002
    Location:
    Posts: 27

    quote:
    --------------------------------------------------------------------------------
    Originally posted by mrrichardfeder

    getURL ("JavaScript:vislayeron('myLayer')");

    --------------------------------------------------------------------------------



    See





    shortandfat webforumsuser@macromedia.com Guest

  2. #2

    Default Re: show hide layer function

    Short:

    Did you see my previous answer to this post from you?

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver MX
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]news://forums.macromedia.com/macromedia.dreamweaver[/url] - THE BEST WAY TO GET
    ANSWERS
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.DreamweaverFAQ.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "shortandfat" <webforumsusermacromedia.com> wrote in message
    news:beghm5$7fi$1forums.macromedia.com...
    > When someone gets a url i want to show a layer
    >
    > I like to show images , steak, tomatoe and shark
    >
    > Now here is something i copied from devshed
    > and it ays its a function getur
    > how would i write this?
    >
    > What would i write in the body script
    > I spent so much time trying to find out. This time i got the script and i
    am halfway there
    >
    > No such thing as 'doent.getLayerById'....unless you created a new
    method.
    >
    > getURL ("JavaScript:vislayeron('myLayer')")???I don't understand this.
    Could someone write the entire script and script in the body that i
    need?short and fat.
    >
    > function getElement(id) {
    > return doent.all ? doent.all(id) :
    > doent.getElementById ? doent.getElementById(id) :
    > doent.layers ? doent.layers[id] : null;
    > }
    >
    > function vislayeron(id) {
    > var el = getElement(id);
    > if (!el) return;
    > if (el.style) el.style.visibility = 'visible';
    > else if (el.visibility) el.visibility = 'show';
    > }
    >
    > function vislayeroff(id) {
    > var el = getElement(id);
    > if (!el) return;
    > if (el.style) el.style.visibility = 'hidden';
    > else if (el.visibility) el.visibility = 'hide';
    > }
    >
    >
    > Last edited by mrrichardfeder on March 26th, 2002 at 07:44 PM
    >
    > Report this post to a moderator | IP: Logged
    >
    > March 26th, 2002 07:34 PM
    >
    >
    >
    > degsy
    > Senior Member
    >
    > Registered: Nov 2001
    > Location:
    > Posts: 657
    > oops, just a typo.
    >
    > doent.getLayerById('divname').style.visibility
    > should be
    > doent.getElementById('divname').style.visibilit y
    >
    >
    >
    > Report this post to a moderator | IP: Logged
    >
    > March 26th, 2002 07:43 PM
    >
    >
    >
    > CODE-Gobbler
    > Junior Member
    >
    > Registered: Mar 2002
    > Location:
    > Posts: 27
    >
    > quote:
    > --------------------------------------------------------------------------
    ------
    > Originally posted by mrrichardfeder
    >
    > getURL ("JavaScript:vislayeron('myLayer')");
    >
    > --------------------------------------------------------------------------
    ------
    >
    >
    >
    > See
    >
    >
    >
    >
    >

    Murray *TMM* Guest

Similar Threads

  1. Menu and Show Hide Layer (broken in IE6)
    By 3hats in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: August 13th, 08:50 PM
  2. Show-Hide Layer positioning
    By snabdab in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: May 10th, 08:44 PM
  3. problem with show-hide layer behavior in IE
    By j baldwin in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: September 10th, 02:46 PM
  4. shortcut to show/hide current layer?
    By felixthehat in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 17
    Last Post: August 23rd, 01:18 AM
  5. show-hide layer trouble
    By macdiva webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 21st, 05:48 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139