By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,278 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,278 IT Pros & Developers. It's quick & easy.

reading image opacity

P: n/a

I am attempting to change the opacity of an image. I can modify opacity ok:

function flip(pic, opacity){
pic.style.filter = 'alpha(opacity='+opacity+')';
}
But I'm not familiar with javascript. How can I read the existing opacity
value?

accessing the value like:

opacity=cell.style.filter.alpha.opacity;

does not work (in IE6).
Also I am having trouble with the equivalent netscape syntax.

Any help would be much appreciated.

TIA

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Dean Edwards" <de@spamfree.com> wrote in message
news:AM*******************@wards.force9.net...

I am attempting to change the opacity of an image. I can modify opacity ok:
function flip(pic, opacity){
pic.style.filter = 'alpha(opacity='+opacity+')';
}
But I'm not familiar with javascript. How can I read the existing opacity
value?

accessing the value like:

opacity=cell.style.filter.alpha.opacity;

does not work (in IE6).
If you have:

<img id=sample src=sample.jpg style="filter:
progid:DXImageTransform.Microsoft.Alpha(opacity=50 )">

than you could do:

sample.filters.item("DXImageTransform.Microsoft.Al pha").opacity += 10;

http://msdn.microsoft.com/library/de...ters/alpha.asp

Also I am having trouble with the equivalent netscape syntax.


Filters are IE specific.

HTH

Vjekoslav
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.