O'Reilly logo

Web Design All-in-One for Dummies® by Sue Jenkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8: Making Your
Pages Interactive
In This Chapter
Adding interactivity with JavaScript
Creating customized rollover effects
Building image maps
Creating a slide show
Inserting multimedia such as Flash, QuickTime, and MP3s
Adding content that changes daily
H
ands down, one of the most interesting aspects of using the Internet is
the fact that visitors can interact in a variety of ways with Web sites.
Many computer users claim, in fact, that they like to spend several hours
each day surfing the Internet to listen to music, watch movies, chat with
friends, play games, read the news, look up the local weather, participate in
forums, browse for products on eBay, research school topics, and more.
There are many different ways to make Web sites interactive, from
the very simple (such as rollover buttons) to the very com-
plex (such as Flash components, QuickTime videos, and
interactive games). For simple functions, you can easily
find free JavaScript code online to add to your pages
without even knowing anything about JavaScript. For
more complex interactive site features, you need
both the multimedia components and their attend-
ing browser extensions or plug-ins (many of which
are free), and you must find out how to properly
insert them onto your pages.
In this chapter, you are introduced to ways of using
JavaScript to make your Web sites more interactive —
such as creating multi-image rollover effects, building
complex image maps, and opening new browser windows.
You also discover how easy it is to insert multimedia files on a
page. Finally, I show you how to add a daily tip on your site on the
topic of your choice and a free JavaScript puzzle or game to entice visitors
to return to the site daily.
21_417966-bk03ch08.qxp 3/25/09 10:40 PM Page 423
Getting to Know JavaScript
424
Getting to Know JavaScript
JavaScript is one of the quickest and easiest ways to add pizzazz to your
Web pages by turning static, regular Web pages into dynamic, interactive,
interesting — and sometimes extraordinary — Web pages.
Without even knowing how JavaScript works, you can use free scripts on
your site to do things like making rollover buttons, launching new browser
windows, turning the browser’s status bar into a message ticker, displaying
the current date and time on the site, creating simple interactive games, and
turning static images into slide shows. Other scripts can be used to gener-
ate browser cookies and build dynamic navigation bars, create special
effects with images and sounds, add computer utilities and perform math
functions, apply password protection to a page, validate forms and e-mails,
and even play interesting background and cursor DHTML animations within
the browser window. Figure 8-1 shows an example of a script from
www.javascriptkit.com that gives your cursor a trailing cursor effect
when a visitor moves his or her mouse around in the browser.
Figure 8-1: JavaScript can enhance a visitor’s experience on a Web site.
21_417966-bk03ch08.qxp 3/25/09 10:40 PM Page 424

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required