Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Hidden and Visible DIVs

Posted on 2000-03-01
5
315 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Read about why website design really matters in today's demanding market.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

809 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