Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Location
    England
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Show - Hiding layer's

    Hi, i hope you guys can help me!!!

    I want to have a javascript command that i can attach to a button which will make a layer on the page visible and another button that will make it invisible.

    Thanks in advance, Chris

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    give the layer an id

    button code:
    <button onclick="document.getElementById('LayerID').style.visibility='visible';">Show</button>
    <button onclick="document.getElementById('LayerID').style.visibility='hidden';">Hide</button>

  • #3
    New to the CF scene
    Join Date
    Jan 2004
    Location
    England
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oh cool thanks for the quick and useful reply.

    Do you have any idea if this code will work to attach to a button in macromedia flash mx ?

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    not being that familiar with flash, but last I checked the buttons had onclick functions I somewhat assume the code would run in those.

  • #5
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    show/hide button

    Hi:

    Saw your hide/show button and works great in NS. How can I get it to work with IE?

  • #6
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    re:

    this is a nice and simple script. thank you very much!!

    one question, tho.

    how could i make the two buttons into one? meaning, have one button to show and hide the layer? Also, could i make it something else besides a button--Ex: a link? I was able to get it hidden on page load (onLoad in the body), which is nice.

    thanks!!!!!

    dan
    dan


  •  

    Posting Permissions

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