Jump to content

Search the Community

Showing results for tags 'visbiliy'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I've got some code that will toggle items on and off, and all works. However, I have 4 items that are clickable, and whichever is clicked, the div field for that item opens in the same area of the sacreen. Therefore, when one of the items is clicked, anything else open needs to close, or they stack on top of each other. I cannot figure out how to get any other items to close when a new one is clicked. Here are the elements I'm using right now: CSS: .unhidden { background-color: #ff0000; height: 190px; width: 300px;} .hidden { visibility: hidden;} JS: <script type="text/javascript"> function unhide(divID) { var item = document.getElementById(divID); if (item) { item.className=(item.className=='hidden')?'unhidden':'hidden'; } } </script> HTML DIV that is clicked: <div><a href="javascript:unhide('ONE');" >ONE</a></div> <div id="ONE" class="hidden">Text that only shows up when ONE is clicked.</div> <div><a href="javascript:unhide('TWO');" >TWO</a></div> <div id="TWO" class="hidden">Text that only shows up when TWO is clicked.</div> <div><a href="javascript:unhide('THREE');" >THREE</a></div> <div id="THREE" class="hidden">Text that only shows up when THREE is clicked.</div> <div><a href="javascript:unhide('FOUR');" >FOUR</a></div> <div id="FOUR" class="hidden">Text that only shows up when FOUR is clicked.</div> I've tried several variations (creating new functions, each that would hide the previous item when clicked), or adding condiitons to the existing JS to hide the others. I'm somewhat of a JS newb, and I could figure this out if it were PHP, but i don't use JS much. This particular task requires JS. Any ideas how to modify what I'm using to work? Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.