Article View: pl.comp.lang.javascript
Article #49670Re: style.display a style w css
From: Paweł Arciszewski
Date: Mon, 11 Jan 2010 11:10
Date: Mon, 11 Jan 2010 11:10
27 lines
2100 bytes
2100 bytes
W dniu 2010-01-11 10:52, mmiarecka pisze:
> On 11 Sty, 10:29, "Mariusz Chwalba"<mari...@chwalba.net> wrote:
>> On Mon, 11 Jan 2010 09:45:53 +0100, mmiarecka<mmiare...@gmail.com> wrote:
>> B d strzela , e pr bujesz odczyta t warto zanim plik CSS si
>> ci gnie. Spr buj wrzuci t funkcj do onload dokumentu.
>
> To sie dzieje w onclicku, gdy wszystko jest juz zaladowane. Zreszta do
> ladowania js uzywam event loadera, ktory czeka az sie dom i reszta
> zaladuje, ale nie w tym rzecz. Problem pojawia sie gdy user kliknie w
> element, ktory sie juz pojawil i to z poprawnymi stylami...
To załatwia sprawę:
function getStyle(el,styleProp)
{
var x = document.getElementById(el);
if (x.currentStyle)
var y = x.currentStyle[styleProp];
else if (window.getComputedStyle)
var y =
document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
return y;
}
Pozdrawiam,
Paweł Arciszewski
Technical Details
Message-ID:
<hif0uv$lp9$1@news.task.gda.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.task.gda.pl!not-for-mailReferences:
<02c9d045-f24c-44a9-ac1d-b1104c699ec0@m26g2000yqb.googlegroups.com> <op.u6c3bno9a6rut4@koder> <7d2baeb5-e635-4298-9eb1-f86fde69c0fa@35g2000yqa.googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.task.gda.pl!not-for-mail From: Paweł Arciszewski <p.arciszewski@archol.pl> Newsgroups: pl.comp.lang.javascript Subject: Re: style.display a style w css Date: Mon, 11 Jan 2010 12:10:23 +0100 Organization: CI TASK http://www.task.gda.pl/ Lines: 27 Message-ID: <hif0uv$lp9$1@news.task.gda.pl> References: <02c9d045-f24c-44a9-ac1d-b1104c699ec0@m26g2000yqb.googlegroups.com> <op.u6c3bno9a6rut4@koder> <7d2baeb5-e635-4298-9eb1-f86fde69c0fa@35g2000yqa.googlegroups.com> NNTP-Posting-Host: 87-205-42-159.adsl.inetia.pl Mime-Version: 1.0 X-Trace: news.task.gda.pl 1263208224 22313 87.205.42.159 (11 Jan 2010 11:10:24 GMT) X-Complaints-To: abuse@news.task.gda.pl NNTP-Posting-Date: Mon, 11 Jan 2010 11:10:24 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pl; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 In-Reply-To: <7d2baeb5-e635-4298-9eb1-f86fde69c0fa@35g2000yqa.googlegroups.com> X-Antivirus: avast! (VPS 100110-1, 2010-01-10), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit