Example
- Go to the class home page and click on the photo links.

- Find an image of yourself or of someone who has given you permission to use their image.
- Click on the image to open large in new window.
-
Drag the image from the browser to the desktop.
- Drag the image from the desktop over the Photoshop icon on the dock

- When the image opens in Photoshop, find the Layers palette F7

- Click on the background and press +J to make a copy

- Make the image smaller. Go to Image>Image Size

- Go to Filter>Liquify

- Play around. When you get something you like, press OK

- Select both layers in the Layers palette
- You want to save each layer as an independent jpeg file. To do that, select
File>Scripts>Export Layers to Files
-
Click on the Browse button and navigate to your web:images folder.

- Click on the New Folder button in the lower left corner of the dialog window
- Name the New Folder rollover

- To select the folder, click on the choose button

- To get the script to run, click on the Run button
- Save the original Photoshop file and close Photoshop.
The XHTML & Javascript part
- Create a new web document +CTRL+N.
- Make sure XHTML 1.0 Strict is selected
- Give your document a title (This is what appears on the top of your browser).
- Press OK
- Save the document in your web folder as rollover1.html.
To preview your page press +CTRL+P
- This is what you should see:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
|
<!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>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Your Title</title>
<meta name="generator" content="BBEdit 7.0.4" />
</head>
<body>
</body>
</html>
|
- Navigate to the <body> tag
- Replace this:
with:
<body style="margin:10%;">
<p style="text-align:center;">
- Navigate to the </body> tag and add a closed </p> tag just before it.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
|
<!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>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Your Title</title>
<meta name="generator" content="BBEdit 7.0.4" />
</head>
<body style="margin:10%;">
<p style="text-align:center;">
</p>
</body>
</html>
|
- You want to place the default image inside the <p></p> tags. Click inside them and press +CTRL+I. Navigate to your rollover folder and select the background image

- Put your cursor inside the img tag:

- Add the following to the tag:

This line will allow you to address the image in Javascript
- Navigate to the <head></head> section (lines 4-8 in my document)
- Add a Javascript declaration:
<script type="text/javascript">
//<!--
//-->
</script>
The second line of the declaration comments out the script. If you do not include these comments when your browser validates the document, it may see the script as invalid XHTML code.
- Add the following lines:
var image1 = new Image();
image1.src = "image_address_of_the_rollover_image.jpg";
var image2 = new Image();
image2.src = "_default_image_address.jpg'";
My addresses were:
images/rollover/_0000_Layer 1.jpg
images/rollover/_0001_Background.jpg
- Add the following functions:
function rollOver(){
document.getElementById('roll').src=image1.src;
}
function rollOut(){
document.getElementById('roll').src=image2.src;
}
- Surround the img tag with this anchor tag:
<a href="#" onmouseover="rollOver();"onmouseout="rollOut();">
</a>
- Save the document.
Linking your work
- Link to and from your home page.
- Open index.html
- Navigate to your table
- Copy the last row:
<tr>
<td class="assignment"><a href="../../../../index.html">Homepage</a></td>
<td class="description">BBEdit and Photoshop</td>
<td class="date">9/20/05</td>
</tr> and paste beneath it:
<tr>
<td class="assignment"><a href="../../../../index.html">Homepage</a></td>
<td class="description">BBEdit and Photoshop</td>
<td class="date">9/20/05</td>
</tr>
<tr>
<td class="assignment"><a href="../../../../index.html">Homepage</a></td>
<td class="description">BBEdit and Photoshop</td>
<td class="date">9/20/05</td>
</tr>
- Change the first column to:
<td class="assignment">Rollover</td>
- Change the second column to:
<td class="description">Photoshop, Image Ready</td>
- Change the third column to:
- In cell 1 of this row set up an anchor container (a link) around the text you added,
linking it to the rollover page in your web folder
- Hilite the word Rollover
- Press +CTRL+A
- Click on the File button
- Navigate to the rollover page in your web folder
- Click on the Choose button
- Click on the Apply button
|