473,320 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

reading image opacity


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
1 4746
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mhoeneveld | last post by:
I am writing a small script to fade the opacity of an image/object. The script itself works fine only I do have some unwanted behaviour. I do use a tablecell object and the mouseover/mouseout to...
6
by: Bryan | last post by:
Hello all, I have an image that is set up like a table of smaller images. Instead of just creating the smaller images separately and putting them together with a table or CSS, I decided to just...
6
by: jesper_lofgren | last post by:
Hi, I wonder if its possible to show and hide a image with javascipt. I want the image to disapear from bottom and up very smooth, maybe under 3-4sec. Is it possible ? any tips ? Thanks
1
by: Romulo NF | last post by:
Greetings everyone, I´ve developed a script to make a slideshow using a holder and the images you need. Just place the images you need within a holder, pass the holder ID to the script and its...
0
by: punitshrivastava | last post by:
Hi to All, I am Punit Shrivastava.i created one html page for this i cde like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
4
by: tetris | last post by:
I have this little code wich is working quite good, it makes a slide show on the body background, anyone could guide me on how to add a fade effect as a transition between the images?? var...
1
by: gangui | last post by:
I need to use an image with opacity for my project, but when I import this with the method bitmap, the image miss the opacity. Since the image is a circle, I also tried to draw the image with the...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.