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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide/show spans using other spans

    Hello everyone.

    I am building a subscription directory website and I need help developing a code that will perform this function:

    I want to be able to hide certain spans when another span appears on the page.

    In other words, the page will normally display <span id="spanA"> and <span id="spanB">.

    However, when <span id="spanC"> appears on a page, I want to set display:none for spanA and spanB.

    I know how to toggle between display:none and display:block using a call to a javascript function like a link with an "onClick"

    Perhaps there a way I could code a span in CSS to toggle this javascript function when it appears on the page?

    Thank you for any help!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    However, when <span id="spanC"> appears on a page, I want to set display:none for spanA and spanB.
    How do you know the time when that span become visible? Or which event/action is controlling the visibility of that span?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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