PDA

View Full Version : Textual tooltip II - display default text?



kidreapertronV
01-22-2009, 06:21 PM
1) Script Title: Textual tooltip II (fade into view)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/linkinfo2.htm

3) Describe problem: A simple question that I couldn't find an answer to when searching the forums. If it has already been addressed, could someone provide a link to the proper thread?

My testing site is here: http://www.unchartedpixels.com/iopo_design/

I would like to have text appear when the page is loaded in the dynamic text area, by default, before the onmouseover event occurs. Anyway to accomplish this?

Thanks so much for any help!

jscheuer1
01-23-2009, 07:27 AM
In this section:


<script language="JavaScript1.2">
if (document.layers){
document.write('<ilayer name="nscontainer" width="100%" height="100">')
document.write('<layer name="fade1" width="100%" height="100">')
document.write('</layer></ilayer>')
}
else
document.write('<DIV ID="fade1"></DIV>')

</script>

add your text, it will disappear once the script is used:


<script language="JavaScript1.2">
if (document.layers){
document.write('<ilayer name="nscontainer" width="100%" height="100">')
document.write('<layer name="fade1" width="100%" height="100">')
document.write('</layer></ilayer>')
}
else
document.write('<DIV ID="fade1">Hi, this is my default text</DIV>')

</script>

If you want to use an apostrophe or single quote characters (') they must be escaped:


document.write('<DIV ID="fade1">Here\'s my default text</DIV>')

kidreapertronV
01-23-2009, 05:10 PM
That's great!

Is there no way to get it to go back to that default text once the user stops hovering over links?

Thanks so much for the help John!

Kiera