Put your files in my dropbox
• Two GIF animations
• Put them in a folder with your
lastname and first initial
• Example:
smith-h
anim1.gif
anim2.gif
GIF animations
JavaScript Rollovers
Rollover Images
• When a user puts the mouse over an
image a new image can be shown
• Uses JavaScript and the DOM
(Document Object Model)
• DOM allows us to identify and
manipulate any element on a Web
page
Triggering Events
<html>
<head>
<script type="text/javascript">
<!--
function testRoll() {
alert('how are you?');
}
//-->
</script>
</head>
<body>
<a href="#" onmouseover="testRoll();">Hello</
a>
</body>
</html>
The JavaScript
<head>
<script type="text/javascript">
<!--
function testRoll() {
alert('how are you?');
}
//-->
</script>
</head>
The Image
<body>
<a href="#"
onmouseover="testRoll();">Hello
</a>
</body>
Button States
• Up – Appears when the page first loads,
the default image
• Over – Appears when the mouse moves
over the image
• Down – Appears after the image has
been clicked, a “pressed” state
• Over While Down – Appears when the
mouse moves over the image in the
Down state
Using Animated Rollovers for
Navigation
Homework, due Sept 9
• Devise a navigation scheme for a website
• Use animated rollovers
• Use all of the 4 states:
Up
Over
Down
Over While Down
• Create one page per navigation item (at least
3 pages) to demonstrate how it works
0 comments
Post a comment