I am new to javascript and having a hard time. I have a class assignment that I have been working on for days...what has to happen is when the mouse rolls over the text an image is to appear. The code I have so far is as follows:
If you have any questions please let me know..I have no idea what to add in the function.
Thanks in advance!
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="core.js"></script>
<script type="text/javascript">
function showMonkey()
{
}
</script>
<style>
.hidden{display: none}
</style>
</head>
<body>
<h2>Adding Event Listeners</h2>
<div>
<h2 style="margin-right:300px">Mouse Here To See Monkey</h2>
<img src="monkey.jpg" id="monkey" class="hidden" />
</div>
<script type="text/javascript">
var image = document.getElementById('monkey');
if(document.attachEvent){
image.attachEvent('mouseover',showMonkey);
}
else if(document.removeEventListener) {
image.addEventListener('mouseover',showMonkey,false);
}
var class = Core.getElementsByClass('hidden');
Core.removeClass(class[0],'hidden');
</script>
</body>
</html>
Thanks in advance!
Comment