DHTML Messages

[Total: 0    Average: 0/5]

This will have a DHTML message show up when you mouse over a link.

Head Code:

<style type="text/css">
<!--
#startingMsg 
	{
	position:absolute;
	background: #0099CC;
	HEIGHT:10;
	TOP:30;
	text-align: middle;
	font-family:Arial, verdana; 
	color:#000000; 
	left:200
	}
-->
</STYLE>

<SCRIPT LANGUAGE="JAVASCRIPT">

messages=new Array(4)

messages[0]="This is a message for LINK #1"

messages[1]="This is a message for LINK #2"

messages[2]="This is a message for LINK #3"

messages[3]="This is a message for LINK #4"

messages[4]=""




var browser;

//if explorer (4.x)

if (document.all) {

		layerRef='document.all.'

		styleRef='.style.'

		changeMessages=".innerHTML=messages[num]"

		closeit=""

		browser=true

}

//else if netscape (4.x)

else if (document.layers) {

		layerRef='document.layers.'

		styleRef='.'

		changeMessages='.document.write(" <font face=VERDANA color=#000000 size=3 style=text-align:middle;background:#FFFFFF;>Link Description:<BR><HR WIDTH=300 ALIGN=MIDDLE NOSHADE><B> "+messages[num]+"</B></font><BR><HR WIDTH=300 ALIGN=MIDDLE NOSHADE>")'

		closeit=".document.close()"

		browser=true

	} 



function mover(num){

	if(browser){

		eval(layerRef+'startingMsg'+changeMessages)

		eval(layerRef+'startingMsg'+closeit);

	}

}

function mout(num){

	if(browser){

		eval(layerRef+'startingMsg'+changeMessages);

		eval(layerRef+'startingMsg'+closeit);

	}

}

</SCRIPT>

Body Code:

<a href="/" onmouseover="mover(0)" onMouseout="mout(4,0)">Link 1</a><P>

<a href="/" onmouseover="mover(1)" onmouseout="mout(4,1)">Link 2</a><P>

<a href="/" onmouseover="mover(2)" onmouseout="mout(4,2)">Link 3</a><P>

<a href="/" onmouseover="mover(3)" onmouseout="mout(4,3)">Link 4</a><P>




<div id="startingMsg">


Thank You for viewing !
</div>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *