1. Home
  2. Computing & Technology
  3. JavaScript

Wandering Hearts

2. Get the Script

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Introduction Add to Your Page

The script for the wandering hearts is in three parts. The first two parts go in the head section of your web page. The first part is the script itself. You need to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called hearts.js.

You next attach the script into your web page that you wish to display your wandering hearts on by adding the following code into the head section of your page. We need a stylesheet for the heart objects so we'll add that at the same time.

<script type="text/javascript" src="hearts.js">
</script>
<style>
#heart0,#heart1 {z-Index:999; visibility:hidden; position:absolute; top:0; left:0; width:69px;}
</style>

The next step is to add the rest of the code to your page.

Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.