473,320 Members | 1,958 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.

Using JavaScript to set filter style

74
Hi there!

I've run into a bit of a problem wherein a <div> containing an error message is made invisible by an animation.

I've tried everything to make this <div> reappear on a button click (set the visibility=visible, set the display=block...etc) but nothing seems to be working.

I think the animation is setting a <div>'s opacity to 0. (I can't find out for sure because something magical is done while using the animation in the Ajax.Net toolkit)


I was wondering how to set the following css using javascript:
Expand|Select|Wrap|Line Numbers
  1.    filter:alpha(Opacity=100);
  2.  
I've tried
Expand|Select|Wrap|Line Numbers
  1.  document.getElementById(nameOfDiv).style.filter = 'alpha(Opacity=100)';
  2.  
However, this doesn't work.
I've checked the w3c site for help on setting the Style Object using JavaScript (found here)...and there is no mention of the filter attribute.

Does anyone know how to to do this?

Thanks a lot!
-LilOlMe
Oct 9 '07 #1
4 5133
lilOlMe
74
Yeah that's just wonderful.
Apparently you can set the opacity of the <div> using
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(nameOfDiv).style.filter = 'alpha(Opacity=100)';
This works fine...(I just needed to clear my cache).

Even though this code works fine, I still can't get my <div> to reappear after that .NET Ajax Tool kit animation fades it out!

Gur

-LilOlMe
Oct 9 '07 #2
acoder
16,027 Expert Mod 8TB
filter only works in IE. You can set style.opacity in browsers such as Firefox and Opera.
Oct 10 '07 #3
lilOlMe
74
filter only works in IE. You can set style.opacity in browsers such as Firefox and Opera.
Oh thanks a lot Acoder :D
I didn't know there was an Opacity attribute in CSS....

As it turns out, I was removing the element I needed to refer to in my Server Side code...I completely overlooked it because it seemed to be an Ajax/JavaScript problem at the time...(oops)

Thanks for your help!
Oct 15 '07 #4
drhowarddrfine
7,435 Expert 4TB
Just to make clear what acoder said above. "filter" is not standard CSS and is an IE propietary property. Although 'opacity' is a standard CSS property, IE doesn't work with it while all other modern browsers will. So, to get IE to act like the modern browsers, you have to use both; 'filter' and 'opacity'.
Oct 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jose Gonzalez | last post by:
How to apply a numeric format to a textbox using xhtml? I know you have to use the "-wap-input-format" style tag in css. I can get this to work in a regular xhtml page, however, I've been...
1
by: John Smith | last post by:
Can you tell me why Mozilla can't show some Javascript? example: function high(which2){ theobject=which2 highlighting=setInterval("highlightit(theobject)",50) } function low(which2){...
8
by: Donius | last post by:
Hello! I've been headhunting for a javascript popup that i saw once, that when it's called, pops open and grows from the center to its desired h and w. Does anyone have any idea where i could...
1
by: Stuart Shay | last post by:
Hello All: I hava a ASP.NET Web Page where I want to change the visibility of a Dropdown, I want to avoid using Postback since the selection of the Dropdown choices is always the same. The Code...
1
by: gencode | last post by:
I have this bit if javascript and it animates an image well, the problem is that the more it runs the more memory it eats on the client machine. Can anyone help me make this not eat all avaliable...
2
by: imingsutantotan | last post by:
Hi, this code below is working on IE 6 and 7 but not mozila firefox. i do not know why I have reviewed the code for 3 times. please help me. regards, Iming <div id="slideShowData"...
6
by: Francesco Moi | last post by:
Hi. I'd like to flip horizontally an image with JavaScript. Is it possible? Thank you very much.
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
0
by: prasanna81 | last post by:
Hi, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0041)http://localhost:8080/vops/SimpleJsp1.jsp --> <HTML><HEAD><TITLE>SimpleExample.jsp</TITLE> <META...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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....

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.