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 element in Firefox. 15 3683
On 6 Okt., 19:56, Sunny <sunnyluth...@gmail.comwrote:
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 element in Firefox.
Hi,
only IE understands filter effects like filter:alpha(opacity=10),
therefore Firefox will throw an error, if you tyr to use them.
I would define a cross browser opacity style definition, like -
/* works but is not valid css */
-
..opacity { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
-
and would only replace the className property using JavaScript -
abc.className = "opacity";
-
Regards,
purcaholic
On Oct 6, 3:27 pm, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 19:56, Sunny <sunnyluth...@gmail.comwrote:
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 element in Firefox.
Hi,
only IE understands filter effects like filter:alpha(opacity=10),
therefore Firefox will throw an error, if you tyr to use them.
I would define a cross browser opacity style definition, like -
/* works but is not valid css */
-
.opacity { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
-
and would only replace the className property using JavaScript -
abc.className = "opacity";
-
Regards,
purcaholic
Hi,
I tried using a class. But to no avail.
That's what I did.
In my style sheet I defined a class.
..style3 {
opacity: 0.9999;
-moz-opacity: 0.9999;
-khtml-opacity: 0.9999;
}
and then I applied that class to the object
element.style3 = ".44";
Is that, What I did is correct or wrong?
Sunny meinte:
Hi,
I tried using a class. But to no avail.
That's what I did.
In my style sheet I defined a class.
.style3 {
opacity: 0.9999;
-moz-opacity: 0.9999;
-khtml-opacity: 0.9999;
}
and then I applied that class to the object
element.style3 = ".44";
Is that, What I did is correct or wrong?
If it were correct, it would have worked. Right?
Perhaps you should familiarize yourself with the basics first...
Anyway, you are looking for element.className = "style3". Changing the
opacity dynamically requires feature testing. Something like
if(typeof element.style.filter === "string") {
element.style.filter = "alpha(opacity="+o+")";
}
else {
element.style.opacity = ""+o/100;
}
Gregor
-- http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie http://web.gregorkofler.com ::: meine JS-Spielwiese http://www.image2d.com ::: Bildagentur für den alpinen Raum
Gregor Kofler wrote:
element.style.opacity = ""+o/100;
As I have showed before,
element.style.opacity = String(o / 100);
is more efficient than that.
However, the `opacity' property is specified and implemented to be of type
Number, not String:
<http://www.w3.org/TR/css3-color/#transparency>
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Thomas 'PointedEars' Lahn meinte:
However, the `opacity' property is specified and implemented to be of type
Number, not String:
<http://www.w3.org/TR/css3-color/#transparency>
On the contrary, browsers (at least the tested FF and Opera) return
"string" when asked for the typeof elem.style.opacity.
Gregor
-- http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie http://web.gregorkofler.com ::: meine JS-Spielwiese http://www.image2d.com ::: Bildagentur für den alpinen Raum
On 6 Okt., 21:36, Sunny <sunnyluth...@gmail.comwrote:
On Oct 6, 3:27 pm, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 19:56, Sunny <sunnyluth...@gmail.comwrote:
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 element in Firefox.
Hi,
only IE understands filter effects like filter:alpha(opacity=10),
therefore Firefox will throw an error, if you tyr to use them.
I would define a cross browser opacity style definition, like -
/* works but is not valid css */
-
.opacity { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
-
and would only replace the className property using JavaScript -
abc.className = "opacity";
-
Regards,
purcaholic
Hi,
I tried using a class. But to no avail.
That's what I did.
In my style sheet I defined a class.
.style3 {
opacity: 0.9999;
-moz-opacity: 0.9999;
-khtml-opacity: 0.9999;}
and then I applied that class to the object
element.style3 = ".44";
Is that, What I did is correct or wrong?- Zitierten Text ausblenden -
- Zitierten Text anzeigen -
Try to set the classname using -
element.className = "style3";
-
If you need several nuances of opacity, then you have to use
javascript, following code should do the trick: -
var oStyle = document.getElementById(id).style;
-
oStyle.opacity = (opacity / 100);
-
if (typeof(oStyle.MozOpacity) === "string") {
-
oStyle.MozOpacity = (opacity / 100);
-
} else if (typeof(oStyle.KhtmlOpacity) === "string") {
-
oStyle.KhtmlOpacity = (opacity / 100);
-
} else if (typeof(oStyle.filter) === "string") {
-
oStyle.filter = "alpha(opacity=" + opacity + ")";
-
}
-
Regards,
purcaholic
On Oct 7, 5:35*am, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 21:36, Sunny <sunnyluth...@gmail.comwrote:
On Oct 6, 3:27 pm, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 19:56, Sunny <sunnyluth...@gmail.comwrote:
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 element in Firefox.
Hi,
only IE understands filter effects like filter:alpha(opacity=10),
therefore Firefox will throw an error, if you tyr to use them.
I would define a cross browser opacity style definition, like -
/* works but is not valid css */
-
.opacity { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1;}
-
and would only replace the className property using JavaScript -
abc.className = "opacity";
-
Regards,
purcaholic
Hi,
I tried using a class. But to no avail.
That's what I did.
In my style sheet I defined a class.
.style3 {
opacity: 0.9999;
-moz-opacity: 0.9999;
-khtml-opacity: 0.9999;}
and then I applied that class to the object
element.style3 = ".44";
Is that, What I did is correct or wrong?- Zitierten Text ausblenden -
- Zitierten Text anzeigen -
Try to set the classname using -
element.className = "style3";
-
If you need several nuances of opacity, then you have to use
javascript, following code should do the trick: -
var oStyle = document.getElementById(id).style;
-
oStyle.opacity = (opacity / 100);
-
if (typeof(oStyle.MozOpacity) === "string") {
-
* * oStyle.MozOpacity = (opacity / 100);} else if (typeof(oStyle.KhtmlOpacity) === "string") {
-
* * oStyle.KhtmlOpacity = (opacity / 100);} else if (typeof(oStyle.filter) === "string") {
-
* * oStyle.filter = "alpha(opacity=" + opacity + ")";}
-
Regards,
purcaholic- Hide quoted text -
- Show quoted text -
Still can't make it work.
I have an xml file with svg shapes.
I am opening the xml file & drawing those shapes on my web page.
Here is the code.
countyVMLArray = resptext.split("<svg")
for(var c=1; c!= countyVMLArray.length; ++c){
color = "#FFFFFF"
countyVMLtext = "<svg" + countyVMLArray[c]
document.getElementById("showit").value = countyVMLtext;
county[c] = new DOMParser().parseFromString(countyVMLtext,
'application/xml');
shps2.appendChild(shps2.ownerDocument.importNode(c ounty[c].documentElement,true));
county[c].value = countyCenters[c-1][1];
county[c].className="style3";
//county[c].opacity = ".2";
//county[c].addEventListener('onmouseover',testMouseover,true );
//county[c].addEventListener('onclick',"testClick", false);
//county[c].fill.opacity = ""+90/100;
//break;
}
And Here is the class style3.
..style3 { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
Also the addeventlistner is not working.
Is that the case that i m trying to change the opacity of vml shape
that's why its not working.
Or What's the problem here?
I also tried, element.style.opacity-that didn't work too.
Gregor Kofler wrote:
Thomas 'PointedEars' Lahn meinte:
>However, the `opacity' property is specified and implemented to be of type Number, not String:
<http://www.w3.org/TR/css3-color/#transparency>
On the contrary, browsers (at least the tested FF and Opera) return
"string" when asked for the typeof elem.style.opacity.
I would presume this to be the result of an implementation-dependent design
decision conforming to ECMAScript (IOW: a bug ;-)) since the arbitrariness
of a string value is unnecessary and unwished for here, and both DOM
implementations accept Number values in the specified range.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
On Oct 7, 8:43*am, Sunny <sunnyluth...@gmail.comwrote:
On Oct 7, 5:35*am, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 21:36, Sunny <sunnyluth...@gmail.comwrote:
On Oct 6, 3:27 pm, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 19:56, Sunny <sunnyluth...@gmail.comwrote:
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 element in Firefox.
Hi,
only IE understands filter effects like filter:alpha(opacity=10),
therefore Firefox will throw an error, if you tyr to use them.
I would define a cross browser opacity style definition, like -
/* works but is not valid css */
-
.opacity { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
-
and would only replace the className property using JavaScript -
abc.className = "opacity";
-
Regards,
purcaholic
Hi,
I tried using a class. But to no avail.
That's what I did.
In my style sheet I defined a class.
.style3 {
opacity: 0.9999;
-moz-opacity: 0.9999;
-khtml-opacity: 0.9999;}
and then I applied that class to the object
element.style3 = ".44";
Is that, What I did is correct or wrong?- Zitierten Text ausblenden -
- Zitierten Text anzeigen -
Try to set the classname using -
element.className = "style3";
-
If you need several nuances of opacity, then you have to use
javascript, following code should do the trick: -
var oStyle = document.getElementById(id).style;
-
oStyle.opacity = (opacity / 100);
-
if (typeof(oStyle.MozOpacity) === "string") {
-
* * oStyle.MozOpacity = (opacity / 100);} else if (typeof(oStyle.KhtmlOpacity) === "string") {
-
-
* * oStyle.KhtmlOpacity = (opacity / 100);} else if (typeof(oStyle.filter) === "string") {
-
-
-
-
-
* * oStyle.filter = "alpha(opacity=" + opacity + ")";}
-
-
-
-
-
-
-
-
Regards,
purcaholic- Hide quoted text -
- Show quoted text -
Still can't make it work.
I have an xml file with svg shapes.
I am opening the xml file & drawing those shapes on my web page.
Here is the code.
* * * * * * * * countyVMLArray = resptext.split("<svg")
* * * * * * * * * * * * *for(var c=1; c!= countyVMLArray.length; ++c){
* * * * * * * * * * * * *color = "#FFFFFF"
* * * * *countyVMLtext = "<svg" + countyVMLArray[c]
*document.getElementById("showit").value = countyVMLtext;
* * * * *county[c] = new DOMParser().parseFromString(countyVMLtext,
'application/xml');
shps2.appendChild(shps2.ownerDocument.importNode(c ounty[c].documentElement,*true));
* * * * *county[c].value = countyCenters[c-1][1];
* * * * * * * * county[c].className="style3";
* * * * //county[c].opacity = ".2";
* * * * *//county[c].addEventListener('onmouseover',testMouseover,true );
* * * * //county[c].addEventListener('onclick',"testClick", false);
* * * * //county[c].fill.opacity = ""+90/100;
* * * * //break;
* * * * *}
And Here is the class style3.
.style3 { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
Also the addeventlistner is not working.
Is that the case that i m trying to change the opacity of vml shape
that's why its not working.
Or What's the problem here?
I also tried, element.style.opacity-that didn't work too.- Hide quoted text -
- Show quoted text -
Hi,
I am able to change the opacity using:
county[c].style.opacity = ""+50/100;
Thanks for everyone's help.
Can someone tell me, How to change the Width & Height of element now:
county[c].style.height = ""+100+"px";
dont work.
Any Suggestions?
On Oct 6, 10:47*pm, Gregor Kofler <use...@gregorkofler.atwrote:
>
else {
* *element.style.opacity = ""+o/100;
}
Beware: if opacity becomes small enough that exponential notation is
turned on, that will fail.
While you can assign opacity= "0.001", opacity= "1e-3" will fail.
AFAIK, last time I checked.
--
Jorge.
On Oct 7, 3:46*pm, Sunny <sunnyluth...@gmail.comwrote:
On Oct 7, 8:43*am, Sunny <sunnyluth...@gmail.comwrote:
On Oct 7, 5:35*am, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 21:36, Sunny <sunnyluth...@gmail.comwrote:
On Oct 6, 3:27 pm, purcaholic <purcaho...@googlemail.comwrote:
On 6 Okt., 19:56, Sunny <sunnyluth...@gmail.comwrote:
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 element in Firefox.
Hi,
only IE understands filter effects like filter:alpha(opacity=10),
therefore Firefox will throw an error, if you tyr to use them.
I would define a cross browser opacity style definition, like -
/* works but is not valid css */
-
.opacity { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
-
and would only replace the className property using JavaScript -
abc.className = "opacity";
-
Regards,
purcaholic
Hi,
I tried using a class. But to no avail.
That's what I did.
In my style sheet I defined a class.
.style3 {
opacity: 0.9999;
-moz-opacity: 0.9999;
-khtml-opacity: 0.9999;}
and then I applied that class to the object
element.style3 = ".44";
Is that, What I did is correct or wrong?- Zitierten Text ausblenden-
- Zitierten Text anzeigen -
Try to set the classname using -
element.className = "style3";
-
If you need several nuances of opacity, then you have to use
javascript, following code should do the trick: -
var oStyle = document.getElementById(id).style;
-
oStyle.opacity = (opacity / 100);
-
if (typeof(oStyle.MozOpacity) === "string") {
-
* * oStyle.MozOpacity = (opacity / 100);} else if (typeof(oStyle.KhtmlOpacity) === "string") {
-
-
-
* * oStyle.KhtmlOpacity = (opacity / 100);} else if (typeof(oStyle.filter) === "string") {
-
-
-
-
-
-
-
* * oStyle.filter = "alpha(opacity=" + opacity + ")";}
-
-
-
-
-
-
-
-
-
-
-
Regards,
purcaholic- Hide quoted text -
- Show quoted text -
Still can't make it work.
I have an xml file with svg shapes.
I am opening the xml file & drawing those shapes on my web page.
Here is the code.
* * * * * * * * countyVMLArray = resptext.split("<svg")
* * * * * * * * * * * * *for(var c=1; c!=countyVMLArray.length; ++c){
* * * * * * * * * * * * *color = "#FFFFFF"
* * * * *countyVMLtext = "<svg" + countyVMLArray[c]
*document.getElementById("showit").value = countyVMLtext;
* * * * *county[c] = new DOMParser().parseFromString(countyVMLtext,
'application/xml');
shps2.appendChild(shps2.ownerDocument.importNode(c ounty[c].documentElement, *true));
* * * * *county[c].value = countyCenters[c-1][1];
* * * * * * * * county[c].className="style3";
* * * * //county[c].opacity = ".2";
* * * * *//county[c].addEventListener('onmouseover',testMouseover,true );
* * * * //county[c].addEventListener('onclick',"testClick", false);
* * * * //county[c].fill.opacity = ""+90/100;
* * * * //break;
* * * * *}
And Here is the class style3.
.style3 { filter:alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; }
Also the addeventlistner is not working.
Is that the case that i m trying to change the opacity of vml shape
that's why its not working.
Or What's the problem here?
I also tried, element.style.opacity-that didn't work too.- Hide quoted text -
- Show quoted text -
Hi,
I am able to change the opacity using:
county[c].style.opacity = ""+50/100;
There should be no need to cast it to a string: see: http://homepage.mac.com/jorgechamorro/cljs/011/
But double check for small values, as it will fail if exponential
notation is turned on...
--
Jorge.
On Oct 7, 4:00*pm, Jorge <jo...@jorgechamorro.comwrote:
>
Beware: if opacity becomes small enough that exponential notation is
turned on, that will fail.
While you can assign opacity= "0.001", opacity= "1e-3" will fail.
AFAIK, last time I checked.
1e-3 won't fail, it has to be yet smaller:
javascript :(function(){document.body.style.opacity =1e-9})() -fails
javascript :(function(){document.body.style.opacity =1e-3})() -ok
--
Jorge.
On Oct 7, 10:30 am, Jorge <jo...@jorgechamorro.comwrote:
On Oct 7, 4:00 pm, Jorge <jo...@jorgechamorro.comwrote:
Beware: if opacity becomes small enough that exponential notation is
turned on, that will fail.
While you can assign opacity= "0.001", opacity= "1e-3" will fail.
AFAIK, last time I checked.
1e-3 won't fail, it has to be yet smaller:
javascript:(function(){document.body.style.opacity =1e-9})() -fails
javascript:(function(){document.body.style.opacity =1e-3})() -ok
--
Jorge.
Hi Jorge, Thanks for that,
Can you tell me How to change the height of an Element in Firefox.
In IE I can change it like that.
county[c].style.width = '2';
county[c].style.height = '2';
But in Firefox its not working.
How can I change the height of an SVG element on webpage dynamically?
Thanks
Sunny wrote:
How can I change the height of an SVG element on webpage dynamically?
What kind of SVG element is that? You need to manipulate its attributes
for instance for a SVG circle element you need to manipulate the radius
attribute r:
svgCircleElement.setAttributeNS(null, 'r', '100');
For a rect element you can set the width and/or height attribute
svgRectElement.setAttributeNS(null, 'width', '200');
svgRectElement.setAttributeNS(null, 'height', '200');
--
Martin Honnen http://JavaScript.FAQTs.com/
On Oct 7, 11:57 am, Martin Honnen <mahotr...@yahoo.dewrote:
Sunny wrote:
How can I change the height of an SVG element on webpage dynamically?
What kind of SVG element is that? You need to manipulate its attributes
for instance for a SVG circle element you need to manipulate the radius
attribute r:
svgCircleElement.setAttributeNS(null, 'r', '100');
For a rect element you can set the width and/or height attribute
svgRectElement.setAttributeNS(null, 'width', '200');
svgRectElement.setAttributeNS(null, 'height', '200');
--
Martin Honnen http://JavaScript.FAQTs.com/
It's a Polygon,
so doing that
county[c].setAttributeNS(null, 'width', '200');
Distort the shape.
But I have a question.
all my 5 polygons have different height & width.
So doing this:
county[c].setAttributeNS(null, 'width', '200');
is not going to work.
as It will change the width of all polygons to 200, so all shapes
distort.
Now My question is as I am appending all the shapes to
shps2.appendChild(county[c]);
so Now all shapes are contained in the shp2 element.
Is there I can Increase the width of this shp2 element.
like shps2.setAttributeNS(null, 'width', '200');
But this is also not working.
I want to change the size of a Big shape that is made up of small 5
polygons.
How I can do that? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Oli |
last post by:
Hi,
I wanted to get some opinions on whether I should consider using
proprietary attributes to apply opacity (until there's support for CSS3
in this area).
Yesterday I came across a site...
|
by: Eric Lindsay |
last post by:
Can someone point me to a good explanation of how to use opacity?
From CSS 3 http://www.w3.org/TR/2003/CR-css3-color-20030514/#opacity
which I read to mean just set a decimal value between 0 and 1...
|
by: dave |
last post by:
I am attempted to make a semi-transparent div in IE/Firefox but IE is
only making the first image in the div opaque
for example if I have a div like:
<div class='trans'><img src="foo.jpg"><img...
|
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...
|
by: Jake Barnes |
last post by:
Please go look at this page using FireFox:
http://www.ralphkrubner.com/Commercial/
Click the "Next" button a few times. The images fade out and then fade
in. It's a nice effect.
Now do try...
|
by: erikito |
last post by:
Hey there!
I've got a little problem with some css I'm using. The opacity at 75% in IE works ok, but I have a problem with the select boxes. They don't seem to react on the following CSS code:
...
|
by: jagadeeshdandu |
last post by:
Hi,
I tried an exaple for opacity like this,
*********************************
<html>
<title></title>
<head>
<style>
.opac
|
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...
|
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 +...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |