
Solid, safe website tools.
Whatever your need, Will Bontrager builds powerful software solutions.
|
(Get Attention Ticker for your web site)
Show/Hide a Div Content LayerBy Will Bontrager This post shows how to implement layers that will display content over existing content at the location specified by you. This is one of three related posts. Each has different features. See this comparison table:
This is the "Show/Hide a Div Content Layer" article. When a link is clicked or a mouse hovers over the link, content will display on top of existing content in a position and size specified in the div's style. A second click or hover will hide the div layer. Here is the JavaScript that will be used to show/hide the floating div layer. The JavaScript is copy 'n paste ready. Prepare the content of the floating div layer like this: The "uniquename" for the id needs to be different than any other id on the web page. We'll assume an id of "uniquename" for the rest of the examples. The style elements display:none; and position:absolute; are required, as are values for the left: and top: elements. The other style elements in the example are optional. Additional elements may be added. The W3schools CSS tutorial is a great place to learn about what is possible. Three different links are available. The links can be located anywhere on the web page, although near the content to be shown/hidden is the usual.
Notice that the id's name is specified in each of the above links. Change 'uniquename' to be the id name of the content div you wish to effect. Customizations: The following applies to any of the above 3 link examples.
One more thing: The floating div layer content itself may have a "hide" link. Example: March 15, 2006 Please note: Articles on this website are presented "as is". However - If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Rate this blog post.
No page reload! |
||||||||||||||||||||||||||||||
|
© 1998-2001 William and Mari Bontrager |
||||||||||||||||||||||||||||||