views:

47

answers:

3

Can we use more than 2 images for single navigation. That means when we hover on that image it will shows 6 different images. Is it possible to make for a single navigation image? If possible means how?

I think you are all understand this

alt text

A: 

If I get your question right, it's possible, but you will have to have 6 different HTML elements to contain the background image at 6 different positions.

Pekka
@Pekka: i need 6 different images on a same place when i navigate on a image
Mubeen
@Mubeen I don't get it. Can you make a graphical example?
Pekka
@Pekka: I add image in my question please go through
Mubeen
+1  A: 

You can (at the moment - cross browser) only set one bg image on an element. If you want to change it on hover or whatever, just add an a-tag with href set on #:

<a class="img" id="thatoneimg" href="#"></a>

And then in the css:

a.img {
  width: 100px;
  height: 100px;
}
a#thatoneimg {
  backround-image: url(staticimg.jpg);
}
a#thatoneimg:hover {
  backround-image: url(movingimg.gif);
}

That should work cross browser. You need the a-tag for it to work in IE.

Edit: As Starx said, just make the second image a .gif with an animation. It will not use sprites but it will work.

Jouke van der Maas
@Jouke van der Maas: ya you are correct but i need more than two images while hovering
Mubeen
I edited my answer to support that.
Jouke van der Maas
Eventually you will be able to use CSS transitions.http://vision-media.ca/resources/css/css-transformations-animations-and-transitions-examples
danixd
+3  A: 

If I understood you correctly, you want to continously change the position of your background image while you hover over one button.

If that's right, then I suggest making a static image as background image and changing the image to a GIF animated image on hover

Starx