Opacity

This is a discussion on "Opacity" within the Web Page Design section. This forum, and the thread "Opacity are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 20th, 2007, 19:41
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 115
Thanks: 2
Thanked 1 Time in 1 Post
Opacity

Hello

I wonder if someone can tell me whether or not it is possible to ADD opacity to images using :hover in my stylesheet, as in:

#rightarea {
..
some images
..
opacity: 0.6;
}

#rightarea img:hover {
opacity: 1.0;
}


So far it seems to be additive but only in a take-away sense, so if I had opacity: 0.8 it would ADD to the already present 0.6 to make it even less opaque, but 1.0 will do nothing, nor will 1.6 or other values greater than 1.0

Any suggestions or help?


Here's my page: http://www.jonathanmortimer.co.uk/te...flatlinks.html

Last edited by jonnymorris; Jul 20th, 2007 at 19:47.
Reply With Quote

  #2 (permalink)  
Old Jul 20th, 2007, 19:46
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,661
Thanks: 0
Thanked 9 Times in 9 Posts
Re: Opacity

there is no such thing as opacity in CSS.. That i know of anyway.
Reply With Quote
  #3 (permalink)  
Old Jul 20th, 2007, 19:49
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 115
Thanks: 2
Thanked 1 Time in 1 Post
Re: Opacity

Quote:
Originally Posted by mmfraser View Post
there is no such thing as opacity in CSS.. That i know of anyway.
We learn something new every day! It's not in my CSS reference book but is in my CSS reference widget (which is much newer), and is understood at least partially by Firefox and Safari.

Reply With Quote
  #4 (permalink)  
Old Jul 20th, 2007, 19:56
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 115
Thanks: 2
Thanked 1 Time in 1 Post
Re: Opacity

Oh it's OK, I moved my opacity declaration to a different tag in my stylesheet and now it works. I'm still getting the hang of this!
Reply With Quote
  #5 (permalink)  
Old Jul 20th, 2007, 19:59
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,661
Thanks: 0
Thanked 9 Times in 9 Posts
Re: Opacity

What tag did you move it to, out of interest?
Reply With Quote
  #6 (permalink)  
Old Jul 21st, 2007, 13:58
Reputable Member
Join Date: Jul 2007
Location: Windsor, ON, Canada
Age: 19
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Opacity

Quote:
Originally Posted by mmfraser View Post
there is no such thing as opacity in CSS.. That i know of anyway.
ahem...

http://www.w3schools.com/css/css_image_transparency.asp

just a lot more complex than just "opacity:0.5;"
Reply With Quote
  #7 (permalink)  
Old Jul 21st, 2007, 14:27
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 115
Thanks: 2
Thanked 1 Time in 1 Post
Re: Opacity

Quote:
Originally Posted by mmfraser View Post
What tag did you move it to, out of interest?
I created thumbnails as a class, thus:

.thumbnails img {
opacity: 0.6;
}

.thumbnails img:hover {
opacity: 1.0;
}

The thumbnails class div surrounds all my thumbnail images.

It's a little more complex though as I also want it to swap the main image AND swap some text (the image caption), I found snippets of code to do this in javascript but they both relied on mouseover, so for the time-being changed one to mousedown and another to mouseup. Eventually I should have both things done on just the one mouse action, but I'm not that good with javascript yet and don't know exactly what goes where. That's another topic though, I think!

Reply With Quote
  #8 (permalink)  
Old Jul 21st, 2007, 14:29
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 115
Thanks: 2
Thanked 1 Time in 1 Post
Re: Opacity

Quote:
Originally Posted by Zonglars View Post
ahem...

http://www.w3schools.com/css/css_image_transparency.asp

just a lot more complex than just "opacity:0.5;"

I'll think about those hurdles when I come to them
Thanks for the link!
Reply With Quote
  #9 (permalink)  
Old Jul 24th, 2007, 21:02
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,946
Blog Entries: 1
Thanks: 0
Thanked 29 Times in 29 Posts
Re: Opacity

For IE: filter:alpha(opacity=80);
For FF etc..: -moz-opacity:.80;
For everything else: opacity:.80;

Code: Select all
filter:alpha(opacity=80);
    -moz-opacity:.80;
    opacity:.80;
That is as long as you dont care if your CSS validates or not.
__________________
I hate IE 6. Just sayin....
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
Reply

Tags
opacity

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
css-opacity motormaniac Web Page Design 5 Apr 16th, 2008 08:16
IE not setting opacity correctly djeyewater JavaScript Forum 4 Feb 8th, 2008 09:57
css opacity effect RZX Developer Web Page Design 6 Aug 7th, 2007 19:05
CSS opacity works in FF but not IE? WebNinja Web Page Design 5 Feb 25th, 2007 22:14
Weird Opacity behavior in PS 7 autumn_whispers2me Graphics and 3D 0 May 3rd, 2005 22:24


All times are GMT. The time now is 13:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43