SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <?php include('menu.php'); ?>

    When I clicked link, menu.php will be opened in div. Is it possible?

    <a>Link</a>
    <div></div>

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <script type="text/javascript">
    function showHide("menu"){
    if(document.getElementById("menu").style.display=='block'){
    document.getElementById("menu").style.display='none'; 
    }else{
    document.getElementById("menu").style.display='block';
    }
    }
    </script><a onClick="showMenu">open menu</a>
    <div id="menu" style="display: none;"><?php include("menu.php"); ?></div>
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    sorry, code messed up!
    this works (tested):
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function showMenu(){
    	if(document.getElementById('menu').style.display=='block'){
    		document.getElementById('menu').style.display='none';
    	}else{
    		document.getElementById('menu').style.display='block';
    	}
    }
    </script>
    </head><body>
    <u onClick="showMenu()">open menu</u><br>
    <div id="menu" style="display: none">aaaaaaaaaaaaaaaaaaa</div></body>
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  4. #4
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot. It works as I expected. Thanks clever boy.
    Last edited by muazzez; Mar 30, 2007 at 02:09.


Bookmarks

Posting Permissions

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