HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Div Layers? Frames?
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame
View previous topic :: View next topic  
Author Message
ouchouch



Joined: 06 May 2008
Posts: 1

PostPosted: Tue May 06, 2008 3:39 am     Div Layers? Frames? Reply with quote

Hi. I'm trying to do something, but I forgot how.
Here's a picture to help you follow along:
http://i31.tinypic.com/29p6c9j.jpg


What I'm trying to do is make it so when you click on any of the top links they will display text/content where the "blah blah blah" part is inside of the DIV.

the text/content doesn't exist on a webpage. It's hidden within the html/source code to only display when the proper link is clicked..

How do I do that with a div? I know I've done it before but I forgot how. Thanks..


Here's another link that shows what I'm talking about in a flash template, scroll down and go to the About me section and click on the links to switch the content to Interests/I'd Like To meet/Music/Etc..:
http://www.lovemyflash.com/layouts/212.html

I done this before using DIV layers.
Anyone have a clue on how to set it up?
Straystudio



Joined: 14 Apr 2008
Posts: 238
Location: Nord Italy

PostPosted: Tue May 06, 2008 4:59 pm     DIV display: none; / display: block; Reply with quote

I apreciate JavaScript changing style of DIVs, from display: none; to display: block;

Play this, based on a "battery" of functions; it also shows three different ways to call JavaScript function
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DIV style="display: ;"</title>

<script language="javascript">
<!--
function showAbout() {
    document.getElementById("About").style.display="block"
    document.getElementById("Music").style.display="none"
    document.getElementById("Books").style.display="none"
    }
function showMusic() {
    document.getElementById("About").style.display="none"
    document.getElementById("Music").style.display="block"
    document.getElementById("Books").style.display="none"
    }
function showBooks() {
    document.getElementById("About").style.display="none"
    document.getElementById("Music").style.display="none"
    document.getElementById("Books").style.display="block"
    }

function shutALL() {
    document.getElementById("About").style.display="none"
    document.getElementById("Music").style.display="none"
    document.getElementById("Books").style.display="none"
    }
// -->
</script>


</head>
<body bgcolor="#444242" text="#ffffff" link="#ffffff" vlink="#ffffff">

<table height="" width="300" border="1" cellpadding="0" cellspacing="0"><tr>
 <td align="center" valign="top">

   <table height="" width="" border="0" cellpadding="2" cellspacing="0"><tr>
    <td align="center" valign="middle">
      <a href="javascript: showAbout();"
       style="text-decoration: none;">About Me
      </a>
    </td>
    </tr><tr>
    <td align="center" valign="middle">
      <span onClicK='showMusic();'>Music
      </span>
    </td>
    </tr><tr>
    <td align="center" valign="middle" onClicK='showBooks()'>
      Books
    </td>
    </tr><tr>
    <td align="center" valign="middle">
      -
    </td>
    </tr><tr>
    <td align="center" valign="middle">
      -
    </td>
    </tr><tr>
    <td align="center" valign="middle">
      <input onClick='shutALL();'
       style="background-color: #444242; color: #ffffff; padding: 0px;"
       type="button" value="( shut any content )">
      </input>
    </td>
    </tr>
   </table>

 </td>
 <td width="100%" align="left" valign="top">

   <div id="About" style="font-size: 14px; display: none;">
    <H3><b>About Me</b></H3>Content 1<br/><br/>
   </div>

   <div id="Music" style="font-size: 14px; display: none;">
    <H3><b>Music</b></H3>Content 2<br/><br/>
   </div>

   <div id="Books" style="font-size: 14px; display: none;
    padding-left: 5%;">
    <H3><b>Books</b></H3>Content 3<br/><br/>
   </div>
    
 </td>
</tr>
</table>
 
</body>
</html>



 
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Webmaster Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial