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

resetting element opacity value

5
sorry another one problem here... i have ink which points to this function:

Expand|Select|Wrap|Line Numbers
  1. opacty= 0
  2. function opacOff() {
  3.     opacty+=10;
  4.         document.getElementById('m').style.filter = "alpha(opacity="+ opacty +")";
  5.         document.getElementById('m').style.MozOpacity = oopacty/100;
  6.     document.getElementById('m').style.opacity=opacty/100;
  7.         setTimeout('opacOff()', 40);    
  8. }
my question is, how to reset opacty of that element, if this function has already run. i mean when i click on link first time opacity animation is ok, but second time just shows that layer without animation. any sggestions? thanx
Sep 7 '07 #1
3 1520
acoder
16,027 Expert Mod 8TB
In your onclick, just set the opacty variable to 0 again.

Changed the thread title to include mention of "opacity".
Sep 7 '07 #2
Cico1
5
In your onclick, just set the opacty variable to 0 again.

Changed the thread title to include mention of "opacity".
thanx!!! anyway, what is the better practice? change it directly through variable (opacty = 0;) or write function and than call that function?
Sep 7 '07 #3
acoder
16,027 Expert Mod 8TB
thanx!!! anyway, what is the better practice? change it directly through variable (opacty = 0;) or write function and than call that function?
It depends on your requirements. If you are going to do it a number of times and possibly intend to add some more related functionality, e.g. every time you reset it you also reset another variable, it might be a good idea to write a function for it.
Sep 8 '07 #4

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

Similar topics

1
by: Dean Edwards | last post by:
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...
0
by: Tom | last post by:
I have an MDI application where I allow the user to set the opacity of the main MDI form (thereby also setting the opacity for any child forms). This works great; however, I notice that if I set...
3
by: VB Programmer | last post by:
I have a form which has an opacity control of type numbericupdown. It's supposed to control the opacity of frmMain. Here's my code... Private Sub numOpacity_ValueChanged(ByVal sender As...
2
by: reidarT | last post by:
I want a windows form to act like the one in Outlook when you get a new message and it is visible for about a couple of seconds and then the opacity decreases and the form dissapears in the end I...
2
by: Trond Michelsen | last post by:
Hi. I have a transparent PNG-image that I would like to display on top of the rest of the web page. I've already got this part working. But, I'd like the background (as in "the part of the image...
0
by: pankajprakash | last post by:
Hi all I am using the Ajax control toolkit and want to the fill the gridview but at the time of rendering it occurs the error "Sys.ArgumentNullException: Value cannot be null. Parameter name:...
5
by: montybytes | last post by:
Hi there, Although, I have already placed this question in the HTML/CSS section, perhaps it might be worthwhile asking the question here as well. I have a JavaScript function which retrieves...
8
by: Sunny | last post by:
Hi, I am creating an Element on page in Firefox. But It gives me an error in Firefox. String contains an invalid character" code: "5 county = document.createElement('"' + countyVMLtext +...
15
by: Sunny | last post by:
Hi, I can change the lement opacity in IE using. abc.style.filter = 'alpha(opacity=' + 10 + ')'; But this dont work in firefox, In firefox it throws error. How I can change the opacity of an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
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: 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.