Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    2
    Member #
    21132
    Dear Guys ,
    I have a page (No 2) that has 3 divs .Let's say Div1 , div2 , div3 .
    Now when i am in another page (No 1) and hit link No 1 i want to open div1 in page 2.
    When i hit link 2 to open div 2 and so on .

    Can you help me ?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Using PHP would be the easiest.
    Do you know anything about PHP?

    You can make a <div> appear or disappear using various properties ...

    Using Visibility ...
    visibility: visible;
    visibility: hidden;

    Using Display ...
    display: none;
    display: block;
    display: inline;

    You didn't provide much information, sorry.


  4. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    2
    Member #
    21132
    My page is php .

    The problem is that i can't pass the data right from the one page to other .
    Look my code ...


    <code>
    <html>
    <head>
    <title>page 1</title>
    </head>

    <body>

    <a href="page2.html?div1">show div 1</a><br>
    <br>
    <a href="page2.html?div2">show div 2</a>

    </body>
    </html>
    </code>

    Page2.html
    <code>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>page 2</title>
    <style type="text/css">
    .show
    {
    visibility:visible;
    }
    .dontshow
    {
    visibility: hidden;
    }
    </style>

    <script type="text/javascript">
    function wp(){
    var fn1=window.location.href
    var fn2=fn1.split("?")
    if (fn2.length>1){
    var fn3=fn2[fn2.length-1]
    x=document.getElementById(fn3);
    x.className="show";
    }
    }
    </script>
    </head>
    <body onload="wp()">
    <div id="div1" class="dontshow">Div 1</div>
    <div id="div2" class="dontshow">Div 2</div>
    </body>
    </html>
    </code>


Remove Ads

Posting Permissions

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

Search tags for this page

select a select to open a div

Click on a term to search for related topics.
All times are GMT -6. The time now is 07:09 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com