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!
Show and Hide functions
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML
View previous topic :: View next topic  
Author Message
stilekid007



Joined: 15 Apr 2005
Posts: 7

PostPosted: Sat Apr 16, 2005 8:38 am     Show and Hide functions Reply with quote

Hello there everyone! Smile

I have a slite problem with my code below... See I want a code that will do something similar to the code below except instead of showing the text only when the user mouses over the "mouse over link" I want it to automatically popup the text and then hide the text after ten seconds and then popup the text after an other ten seconds and then hide it and so on...

I have been trying to figure it out but I am such a code newbie I couldn't get it.. I would appreciate any comments anyone may have!

Thank you and have a great day! Very Happy (The show and hide code is below)


Code:

<html>
<head>
<title>:::show.hide:::</title>

<script type="text/javascript">
<!--
function ShowHide(id, visibility) {
    obj = document.getElementsByTagName("div");
    obj[id].style.visibility = visibility;
}
//-->
</script>

<style type="text/css">
<!--
#sub1Div
{
visibility:hidden;
width:80px;
height:80px;
position:absolute;
left:200px;
top:20px;
border:1px solid #151515;
}

#sub2Div
{
visibility:hidden;
width:80px;
height:80px;
position:absolute;
left:200px;
top:105px;
border:1px solid #151515;
}

#sub3Div
{
visibility:hidden;
width:80px;
height:80px;
position:absolute;
left:200px;
top:190px;
border:1px solid #151515;
}
-->
</style>

</head>
<body>

<div id="sub1Div"> sub1</div>
<div id="sub2Div"> sub2</div>
<div id="sub3Div"> sub3</div>

<p>onclick-method</p>

<p>
<a href="javascript:ShowHide('sub1Div','visible')">show.sub1</a> |
<a href="javascript:ShowHide('sub1Div','hidden')">hide.sub1</a>
</p>

<p>
<a href="javascript:ShowHide('sub2Div','visible')">show.sub2</a> |
<a href="javascript:ShowHide('sub2Div','hidden')">hide.sub2</a>
</p>

<p>
<a href="javascript:ShowHide('sub3Div','visible')">show.sub3</a> |
<a href="javascript:ShowHide('sub3Div','hidden')">hide.sub3</a>
</p>


<p>onmouseover-method</p>

<p>
<a href="javascript:ShowHide('sub1Div','visible')"
      onmouseover="ShowHide('sub1Div','visible')"
      onmouseout="ShowHide('sub1Div','hidden')">
      showhide.sub1
</a>
</p>

<p>
<a href="javascript:ShowHide('sub2Div','visible')"
      onmouseover="ShowHide('sub2Div','visible')"
      onmouseout="ShowHide('sub2Div','hidden')">
      showhide.sub2
</a>
</p>

<p>
<a href="javascript:ShowHide('sub3Div','visible')"
      onmouseover="ShowHide('sub3Div','visible')"
      onmouseout="ShowHide('sub3Div','hidden')">
      showhide.sub3
</a>
</p>

</body>
</html>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML 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   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial