472,378 Members | 1,503 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 5058
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.