noon said:
Is there a way to assign '-moz-corner-radius' with js?
Yes, there is. I use
setStyleProperty(
getElem('id', 'topLeft'),
'MozBorderRadiusTopleft',
'7px');
in <
http://pointedears.de/ufpdb/celestia/?file=planetcl> and other documents
(PHP-generated), whereas setStyleProperty() is defined in
<
http://pointedears.de/scripts/dhtml.js> (licensed under the GNU GPL 2.0 or
later) as follows:
/**
* Sets the value of a style property of an HTMLElement object.
*
* @author
* (C) 2003-2006 Thomas Lahn <
[email protected]>
* @partof
*
http://pointedears.de/scripts/dhtml.js
* @argument o: HTMLElement
* Reference to the element object which style is to be modified.
* @argument sPropertyName: string
* Name of the style property of which the value should be set.
* If "display", there is no
* <code>style[<var>sPropertyName</var>]</code>
* property, and <code>altValue</code> was provided, "visibility"
* is used instead (fallback for the NN4 DOM).
* @argument propValue
* Value of the style property to be set.
* @argument altValue: optional _
* Alternative value to be set if the the style property is a property
* of the object itself instead of its `style' property. Fallback for
* the NN4 DOM.
* @return
* <code>false</code> if no such object exists or if the
* DOM does not provide for setting the property value.
* @type boolean
*/
function setStyleProperty(o, sPropertyName, propValue, altValue)
{
if (o)
{
sPropertyName = sPropertyName.replace(
/-([a-z])/gi,
function(m, p1) { return p1.toUpperCase(); });
if (typeof o.style != "undefined")
{
if (typeof o.style[sPropertyName] != "undefined")
{
// NOTE: Shortcut evaluation changed behavior
o.style[sPropertyName] = propValue;
return (String(o.style[sPropertyName]).toLowerCase()
== String(propValue).toLowerCase());
}
}
else
{
if (sPropertyName == "display" && altValue)
{
sPropertyName = "visibility";
}
if (typeof o[sPropertyName] != "undefined")
{
var newValue = (altValue || propValue);
o[sPropertyName] = newValue;
return (String(o[sPropertyName]).toLowerCase()
== String(newValue).toLowerCase());
}
}
}
return false;
}
While I am against browser-specific code, this is part of a firefox
extension so it's guaranteed that the user will be running firefox.
That would not matter with the above feature tests.
PointedEars