| Liam Delahunty: Home | Tips | Web | Contact |
|---|
|
Recommended laptop
under £500. Think I deserve a present? See my Amazon Wish List |
Dynamic Roll-over Content Using innerHTML
Look here !!!
In the head section include the scipt
<script language="JavaScript">
<-- //
whoText = "Liam Delahunty";
howText = "Follow the instructions and look at the <b>source</b> code here. ";
whyText = "Why not?";
function displayText(text){
if (document.all) {
document.all['displayLayer'].innerHTML = eval(text);
} else {
var couldbenetscape = document.getElementById("displayLayer");
couldbenetscape.innerHTML = eval(text);
}
}
// -->
</script>
in the body
<p>[
<a href="#" onMouseOver="displayText('whoText');">Who</a> |
<a href="#" onMouseOver="displayText('howText');">how</a> |
<a href="#" onMouseOver="displayText('whyText');">why</a> ]
</p>
<div id="displayLayer" style="width: 600; z-index: 10;"> </div>
Share this! |