Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- button.setAttribute('style', 'float: right;');
- button.style = 'float: right;';
- button.style.setAttribute('cssFloat','right');
- button.style.cssFloat = 'right';
- function setStyle(el,spec) {
- for (var n in spec) {
- el.style[n] = spec[n];
- }
- }
- setStyle(button,{
- cssFloat : 'right',
- border : '2px solid black'
- });
- button.style.cssText = 'float: right;';
- button.style.cssFloat = 'right';
- button.className = 'a class that matches a pre-written CSS rule-set';
- //Set Property
- this.setProperty = function (a, b) {
- var c = this.element.getAttribute("style");
- var d;
- if (!c) {
- this.element.setAttribute("style", a + ":" + b);
- return;
- } else {
- d = c.split(";")
- }
- for (var e = 0; e < d.length; e++) {
- var f = d[e].split(":");
- if (f[0].toLowerCase().replace(/^s+|s+$/g, "").indexOf(a.toLowerCase().replace(/^s+|s+$/g, "")) == 0) {
- d[e] = a + ":" + b
- }
- }
- d[d.length] = a + ":" + b;
- this.element.setAttribute("style", d.join(";"))
- }
- //Remove Property
- this.removeProperty = function (a) {
- var b = this.element.getAttribute("style");
- var c;
- if (!b) {
- return
- } else {
- c = b.split(";")
- }
- for (var d = 0; d < c.length; d++) {
- var e = c[d].split(":");
- if (e[0].toLowerCase().replace(/^s+|s+$/g, "").indexOf(a.toLowerCase().replace(/^s+|s+$/g, "")) == 0) {
- c[d] = ""
- }
- }
- this.element.removeAttribute("style");
- this.element.setAttribute("style", c.join(";").replace(";;", ";"))
- }
- node.style.z-index = 50;/Firefox says error, invalid assignment left hand side.
- node.style["z-index"] = "50";//Works without error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement