jquery - CSS background-position change on Y-Axis only -


OK ... so here's the problem.

I have a CSS phantom image, ten (10) 25px x 25px icons exit horizontally - thus a phantom image of 250px width is generated.

I am using these 25x25 images as thumbnails I have the opacity of 30% in the INITIAL view in these images and when a user hovers over them, the ambiguity is 100% (1) the wanted.

So what I did was the line of images with my own ambiguity at 30% - so now I have a phantom image of 250px x 50px. 25px at top 100% and below 25px 30%.

I have setup HTML as follows:

  & lt; A href = "bigimage1.jpg" class = "thumb1" & gt; & Lt; / A & gt; & Lt; A href = "bigimage2.jpg" square = "thumb 1" & gt; & Lt; / A & gt; & Lt; A href = "bigimage2.jpg" square = "thumb 1" & gt; & Lt; / A & gt; Etc ...  

and CSS:

  a {display: block; Swim left; Width: 25px; Height: 25px; Background: URL ("250_x_50_spriteimage.jpg") 0 -25px no-repeat; }. Thumb1 {background-position: 0 0; }. Thumb2 {background-position: -25px 0; }. Thumb 3 {background-position: -50px 0; } A: Hover {** background-position-y **: -25px; }  

However, it does not work unfortunately, because background-position-W is not supported in Firefox (or not standard, but it is IE-specific).

The idea is that we want to shifat (only) the sprite image UP (with the Y-axis) and leave the x-axis (or set in the previous class).

If there is no simple CSS solution on this - can this ambiguity effect be done with JQUERY?

Many thanks,

M.

So thumb is loaded at 30% opacity and 100% is ambiguous infection?

You do not need to set a second icon to get the desired effect, and neither Javascript is used.

As told by Lo, use opacity to make your mouse 30% or completely visible, messing with background-condition There is no need for that.

Just go ahead and define your style according to:

  a {opacity: 0.3; / * Standard / Browser for filter: Alpha (Opacity = 30); / * IE * / display: block; Swim left; Width: 25px; Height: 25px; Background: URL ("250_x_50_spriteimage.jpg") 0 -25px no-repeat; } A: Hover {Opacity: 1.0 Filters: Alpha (Opacity = 100); }. Thumb1 {background-position: 0 0; }. Thumb2 {background-position: -25px 0; }. Thumb 3 {background-position: -50px 0; }  

If you are concerned about the validity of your CSS code, then take IE-specific parts (which will not be valid) and put them in specially targeted CSS files.

Hope that helps.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -