Skip navigation
Currently Being Moderated

Looking for simple "hide/unhide" method...

Aug 9, 2012 2:37 PM

Hi,

 

I'm looking for a way to hide/unhide specifically targeted divs.

 

Example :
<a href="hide_div1, hide_div2, show_div3">Link</a>

<a href="hide_div1, hide_div3, show_div2">Link</a>

<a href="hide_div2, hide_div3, show_div1">Link</a>

 

<div id="div1">Test 1</div>

<div id="div2">Test 2</div>

<div id="div3">Test 3</div>

 

Know what I mean?

 
Replies
  • Currently Being Moderated
    Aug 9, 2012 3:39 PM   in reply to jyeager11

    Try this jQuery solution: http://jsfiddle.net/XwN2L/

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 8:12 AM   in reply to jyeager11

    Take a look at the source code on:

    http://www.olympicdiscoverytrail.com/

    There are multiple hidden <div>s on the far left and far right columns..... the "Read More" sections.

    You can show and hide each independant of the others... having as many showing as you want.

     

    <script type="text/javascript" language="JavaScript">

    <!--

    function HideContent(d) {

    document.getElementById(d).style.display = "none";

    }

    function ShowContent(d) {

    document.getElementById(d).style.display = "block";

    }

    function ReverseDisplay(d) {

    if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }

    else { document.getElementById(d).style.display = "none"; }

    }

    //-->

    </script>

    then give each of the <div>s a unique name:

    <div id="home1" style="display:none">

    Best wishes,

    Adninjastrator

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 4:03 PM   in reply to jyeager11

    You must be using the hide/show in a way that I am not because I cannot replicate your problem. Interaction with the lower <div> works just fine, whether or not the top <div> is visible or invisible.

    Best to post a test page illustrating your problem.

    Here is my test page:

    http://www.olympicdiscoverytrail.com/index_show_hide_test.html

    note in the far left column, "Forests of the Pacific Northwest"... has a "Read More"... whose content (according to you, should cover up the interactive part of "Rivers and Bridges"

    But even with the top <div> not displaying, I can interact with the "Rivers and Bridges" section just fine, including a link embed in the none displayed part... open the "Read More" of "Rivers and Bridges" to see what I mean.

    Best wishes,

    Adninjastrator

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2012 12:05 AM   in reply to jyeager11

    Can be hidden by absolute positioning  www.realmapa.com

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points