Skip to main content
Participant
Sep 1, 2017 8:31 AM UTC
Answered

RollOver Image and OnClick Event

Hello.

I want to make a rollover button and when I click it to change the button's image to Image_SELECTED image.

I have 3 images for the button

Image_NORMAL

Image_MOUSEOVER

Image_SELECTED

How can I do to change the button's image with Image_SELECTED image and the button still work correctly on Mouse Rollover ?

I want to use Image Behavoirs for that purpose.

Thank You !

This topic is closed to new replies. Start a new post to keep the conversation going.
italosan
italosanCorrect answer
Community Expert
Sep 2, 2017 10:39 AM UTC

hi tomcat2900 ,
if you want to use behaviours
and not "external" DW technologies you can try a combo of classical swap/restore image via the "Behaviours" panel and mix it with a "Show-Hide Elements" for the "Image_SELECTED". But in this case you will need an element (a div with an image or an image) with absolute positioning matching the same position of your button (I assume its a button).

hope this can be of any help. Cheers.

6 replies

italosan
Community Expert
italosanCommunity ExpertCorrect answer
Community Expert
Sep 2, 2017 10:39 AM UTC

hi tomcat2900 ,
if you want to use behaviours
and not "external" DW technologies you can try a combo of classical swap/restore image via the "Behaviours" panel and mix it with a "Show-Hide Elements" for the "Image_SELECTED". But in this case you will need an element (a div with an image or an image) with absolute positioning matching the same position of your button (I assume its a button).

hope this can be of any help. Cheers.

Translate
Participant
Sep 3, 2017 7:45 PM UTC

Thank You All for your answers !

Translate
Participant
Sep 2, 2017 10:22 AM UTC

But I want to use only Dreamweaver Image Behavoirs...

Please tell me how can I do that.

Thank You !

Translate
Nancy OShea
Community Expert
Community Expert
Sep 2, 2017 4:27 PM UTC

tomcat2900  wrote

But I want to use only Dreamweaver Image Behavoirs...

Image behaviors alone won't do what you want.  You still need some CSS.

Translate
Nancy O'Shea— Product User & Community Expert
hans-g.
Legend
Sep 2, 2017 7:47 AM UTC

Hello Tom,

as an addition: I like to use this disjont technique, as you can it see there: DisjointTest ​

It might be of interest to you.

Hans-Günter

P.S.

It's Dreamweaver technique, you simply could use the source code adapted to your needs. The theory behind this is written in italosan's reference.

Translate
Nancy OShea
Community Expert
Community Expert
Sep 1, 2017 3:36 PM UTC

You do not need complicated JavaScript behaviors for this.  Use pure CSS instead.

CSS Button Sprite - http://alt-web.com/

Nancy

Translate
Nancy O'Shea— Product User & Community Expert