How can we change the background-position of images

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
betsy
Beginner
Beginner
Posts: 2
Joined: Tue Nov 01, 2005 5:52 pm
Location: Germany

How can we change the background-position of images

Post by betsy »

We want to style our menu in the following manner:

The background images should be different for all menu items.

a1("align=center;bgimage=disco.gif;text=Disco");

My Question:
How can we change the background-position.

Background: We want to use rollover effects without preloading the images.
In CSS:

.elem {background-image:url(URL);background-position:0 0}
.elem:hover {background-image:url(URL);background-position:100 10}
:?:
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Since you are using css, you can create classes and use the built in offclass and onclass functionality of the menu. I'm not sure on the .elem:hover as the name. I think that colon might cause a problem so you might have to create it as .elem and .elemover or o or something. You should be able to use the same css coding as you have now and then just call the applicable class in the aI.

aI("whatever stuff;offclass=elem;onclass=elemover;");

There is a very, very basic beginners' guide example of styling the menu with css viewtopic.php?t=6392

Ruth
betsy
Beginner
Beginner
Posts: 2
Joined: Tue Nov 01, 2005 5:52 pm
Location: Germany

thanks!

Post by betsy »

Hi,

thanks for your help and support. :D
Post Reply