Solved

Hidden and Visible DIVs

Posted on 2000-03-01
5
324 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
ID: 2574561
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
ID: 2578341
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
ID: 2580152
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
ID: 2592542
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
ID: 2592721
cavacasp:

Happy to be of assistance.

Tom
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

680 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