Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1514651.RQZaLltAgF@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 10 Jul 2013 21:27:38 +0200 User-Agent: KNode/4.10.4 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <2695770.PYp8NcyyIf@PointedEars.de> MIME-Version: 1.0 Lines: 67 NNTP-Posting-Date: 10 Jul 2013 21:27:40 CEST NNTP-Posting-Host: 59afb891.newsspool3.arcor-online.net X-Trace: DXC=bjPZQ1B3c43lIh70@DZm8W4\YJN]gf>b6?FFQ?U;99 X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:20608 Cezary Tomczyk wrote: > On 2013-07-09 22:18, Thomas 'PointedEars' Lahn wrote: > [...] > >> var div = document.createElement("div"); >> div.style.zIndex = 1701; >> div.style.position = "fixed"; >> div.style.top = "0"; >> div.style.left = "0"; >> div.style.bottom = "0"; >> div.style.right = "0"; >> div.style.cursor = "wait"; >> >> (Or >> >> var div = jsx.dom.createElementFromObj({ >> type: "div", >> properties: { >> style: { >> position: "fixed", >> top: "0", >> right: "0", >> bottom: "0", >> left: "0", >> zIndex: 1701, >> "background-color": "rgba(0, 0, 0, 0.5)", >> cursor: "wait" >> } >> } >> }); > [...] > > Or > > var div = document.createElement('div'); > div.style.cssText = 'z-index: 1701; position: fixed; top: 0; left: 0; > bottom: 0; right: 0; cursor: wait;'; The Matrix has you. This also works in IE 6.0.2800.1106, although I cannot say at this time if it works everywhere where client-side CSS scripting is supported. I cannot prove it yet, but previous experience suggests that the first approach, implemented in jsx.dom.css.setStyleProperty() as called by jsx.dom.createElementFromObj(), works everywhere short of NN4, friends and older relatives. Another advantage of jsx.dom.createElementFromObj() over your approach is its versatility with regard to properties and tree depth. If you build document subtrees from Object instances, you can define entire layouts in one object instead of lengthy, more error-prone string values, or tedious and more error-prone “RY” DOM statements. > Just one thing: shouldn't be here 0px instead of 0? Just regarding > http://devtoolsecrets.com/secret/editing-incrementing-css-values.html If you intend to use the CSS Inspector for experimenting with suitable values as described, *and* you not want to type the unit (e.g., “px”) before you can do that, you should write "0px" or whatever unit of length you prefer. Otherwise it is just a waste of space. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.