Solved

Hidden and Visible DIVs

Posted on 2000-03-01
5
265 Views
Last Modified: 2013-12-25
I have an unorder list of items that are hyperlinks.  I also want to have a DIV on the same line as the list item, just to the right of it.  This DIV should be invisible when the page is loaded.
When a person moves over the link I want to corresponding DIV to become visible and when they move off the link the div should be invisible again.

Just for an example create a list with the following items; Sleep, Disease, Blindness and each of the corresponding DIV should be contain the words Caused By.
0
Comment
Question by:cavacasp
  • 3
5 Comments
 
LVL 9

Expert Comment

by:TTom
Comment Utility
Try this out.  It will work in IE, but you will have to play with it to get it functional in NS.

<html>
<head>
<title>Tom's Test Page</title>
<script language=JavaScript>
<!-- Hide from older browsers

//-->
</script>
</head>
<body>
<!-- Remember to save this page with another name -->
<hr>
<div name=div1 id=div1 onmouseover="div2.style.visibility='visible'"

onmouseout="div2.style.visibility='hidden'">Sleep <span name=div2 id=div2

style='hidden'>caused by</span></div>
</body></HTML>

Tom
0
 
LVL 1

Expert Comment

by:MikeyG
Comment Utility
Even better, use:

<div name=div1 id=div1 onmouseover="div2.style.display='block'"

onmouseout="div2.style.display='none'">Sleep <span name=div2 id=div2

style='display:none'>caused by</span></div>

Because the display property determines whether the div is actually rendered, and any text/tags underneath the div will get shifted up.  But then again, I'm not sure how compatible this is with NS...
0
 
LVL 9

Expert Comment

by:TTom
Comment Utility
More info.

The "display" property (probably because it does not render the div) makes the span display below the first (as opposed to alongside it).

Niether of these bits works in NS, but I THINK, NS supports different properties for "visibility", i.e. M$ = "visible"; NS = "show", or something like that.

There are also going to be problems with whether or not NS supports the visibility property of a <DIV> or <SPAN>.

In any case, here is a link to the NS documentation on working with "positioned" blocks of text, etc.

http://developer.netscape.com:80/docs/technote/dynhtml/css/css.htm

FWIW, the NS developer site definitely has some more info on this stuff.  Go and search the site for "visibility".

HTH,

Tom
0
 

Author Comment

by:cavacasp
Comment Utility
TTom submit as an answer.  That works just like I need it to, expect of course you had one small mistake in this line
style='hidden'
where it should have been
style='visibility:hidden'

0
 
LVL 9

Accepted Solution

by:
TTom earned 150 total points
Comment Utility
cavacasp:

Happy to be of assistance.

Tom
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now