Rollover buttons

They have: 5 posts

Joined: Aug 2001

Help please. After you create a button in photoshop 6 and then the rollover effects in Image Ready, how do you save the image and incorporate it in your webpage. I saved it as a gif, but the effects do not work. Thanks.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

There are a few options here. When you create your rollovers in ImageReady, choose "save optimized" from the file menu - this should create an HTML file for you with the rollover script included. I don't know why this wouldn't work. Then all you have to do is either build your page around that or copy and paste that code into another HTML page.

However, IR does write some rather messy code, so you might be better off taking the images it generates and plugging them into another script. Yet another option would be to use an HTML editor to generate the rollovers for you - what are you using to write your code? Some of them have easy rollover tools.

They have: 6 posts

Joined: Aug 2001

i use this generator to make my rollovers, it only lets you do 5 at a time, but it's really easy and it does the preloading scripts for you too.

preload images and rollover generator

Hope that helps Smiling

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Rolling your own script is pretty easy for mouseovers, plus you can reuse the code on other sites. Here is how.

This Part goes in the Head

&lt;script language=javascript type="text/javascript"&gt;<!--Begin Script Hide

if (document.images) {
img1on = new Image
img1on.src = "images/img1on.gif"


img1off = new Image
img1off.src = "images/img1off.gif"

}

function chgImg(imgfield,newImg) {
if (document.images) {
document[imgfield].src= eval(newImg + ".src")
}
}

//End Script Hide -->
&lt;/script&gt;
'

The body looks kind of like this:

So basically you will have an on and an off graphic. You are creating a function called chgImg that will call this new image. The biggest mistake usually made is that people name ('img1', ...) different from and the script errors out on them. You can add images to this function by just putting in:

img2on = new Image
img2on.src = "images/img2on.gif"

img2off = new Image
img2off.src = "images/img2off.gif"

Personal preference is that I will put all my on's and all my off's together like:

img1on = new Image
img1on.src = "images/img1on.gif"
img2on = new Image
img2on.src = "images/img2on.gif"

It is really too easy.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 40 posts

Joined: Jul 2001

I'm not quite sure on how good the code is but dreamweaver makes it really easy for you to do rollovers. I usually just make the images and let dreamweaver do the magic. Good luck!

PUNKK

Keegan's picture

They have: 300 posts

Joined: Aug 2001

cntrl n

DESIGN

select area

cntrl shift c

cntrl n

cntrl v

cntrl alt shift s

[save image to directory}

cntrl w

right arrow

space bar

cntl J

double click selected layer

give it bevel

click ok

cntrl shift d

cntrl n

cntrl v

cntrl alt shift s

save to directory with _b on the end

That is how I slice out my sites.

The above shortcut theme was for buttons for mouseovers in ps6

Yes I am CRAZY! mwha mwha mwhaaaa

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.