
Solid, safe website tools.
Whatever your need, Will Bontrager builds powerful software solutions.
|
(Get Attention Ticker for your web site)
Floating Layer At Cursor PositionBy Will Bontrager This post shows how to implement layers that will display content over existing content just below and to the right of the cursor position. This is one of three related posts. Each has different features. See this comparison table:
This is the "Floating Layer At Cursor Position" article. Three different methods are provided for displaying content near the user's cursor. (The content is in a <div... tag with certain style attributes.) Each method contains a link (or links) that will reveal or hide certain content. The examples in the list are copied and pasted right from the code presented in this article.
Some JavaScript needs to be on every page where any of the display methods are used. The JavaScript only needs to be on the page one time, even if you have more than one content div to display on the page. Here is the JavaScript. Copy 'n paste it into your web page (or into a file imported into your web page). The JavaScript can be put pretty much anywhere on the page, in the BODY or HEAD area.. Below, you'll find the code for each of the three content display methods. Toggle Display. Here is the code to toggle the display of the content show it, if it's hidden; hide it, if it's showing. Change the content as you please. Show Content. Content Has "Hide" Link. Here is the code to show the content. Then in the content itself is a link to hide it. Change the content as you please, keeping the "hide" link. Show Content On Mouseover. Hide Content On Mouseout. Here is the code to show the content when the mouse moves over it, and hide the content when the mouse moves off. Change the content as you please. Show Content On Mouseover. Hide Content On Mouseout. Content Follows Mouse. Here is the code to show the content when the mouse moves over it, and hide the content when the mouse moves off. It also causes the content to follow the mouse as it moves over the link (thank you for the suggestion, Cam). Change the content as you please. Notes Note that each of the above implementation example sets has a different id="______". When more than one set is used on the same page, the id="______" of each set must be unique. Edits that may be made:
You'll find a lot of room for creativity in the above code. May 3, 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 |
||||||||||||||||||||||||||||||