🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #39886

Re: zmiana elementu klasy css

#39886
From: Bogdan Blaszczak
Date: Mon, 15 May 2006 21:59
28 lines
1899 bytes
Kudłaty napisał(a):

> Genialne ;)
> Udało mi się co miałem zrobić. A powiedz mi proszę czy da się odwołać do
> tego przez 'nazwę', lub znaleźć tą nazwę (wtedy poradzę sobie w pętli).

Da sie

function zmienKlase(rule,property,value){
  var i,R=document.all?'rules':'cssRules'
  R=document.styleSheets[0][R]
  for(i=0;i<R.length;i++)
   if(R[i].selectorText==rule)
    R[i].style[property]=value
}

wywolanie
zmienKlase('.klasa','margin','100px')

Nie wiem dlaczego Ci to nie dziala w Mozilli. Moze masz jakis drobny 
blad formalny w samym arkuszu CSS. Silnik Gecko jest czuly na takie 
bledy i moze sie sypnac..
Aż sprawdzilem dokladniej. Mnie to dziala na wszystkich wersjach 
Mozilli/FF jakie mam. A troche ich mam ;)
Dziala nawet na bardzo leciwym Firebird 0.7 (wersja z 2003)

-- 
BlaTek
Technical Details
Message-ID: <e4atog$bcb$1@nemesis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <e48fnp$s95$1@atlantis.news.tpi.pl> <e4acu6$rk1$1@atena.e-wro.net> <e4alqh$5ac$1@atlantis.news.tpi.pl> <e4amv7$j0c$1@nemesis.news.tpi.pl> <e4an5o$alc$1@atlantis.news.tpi.pl> <e4aqou$t78$1@nemesis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: Bogdan Blaszczak <blatek@UsuN-AntyspaMpoczta.wprost.pl>
Newsgroups: pl.comp.lang.javascript
Subject: Re: zmiana elementu klasy css
Date: Mon, 15 May 2006 23:59:38 +0200
Organization: Disorganization Department
Lines: 28
Message-ID: <e4atog$bcb$1@nemesis.news.tpi.pl>
References: <e48fnp$s95$1@atlantis.news.tpi.pl> <e4acu6$rk1$1@atena.e-wro.net> <e4alqh$5ac$1@atlantis.news.tpi.pl> <e4amv7$j0c$1@nemesis.news.tpi.pl> <e4an5o$alc$1@atlantis.news.tpi.pl> <e4aqou$t78$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: ejc98.internetdsl.tpnet.pl
Mime-Version: 1.0
X-Trace: nemesis.news.tpi.pl 1147730512 11659 83.15.84.98 (15 May 2006 22:01:52 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Mon, 15 May 2006 22:01:52 +0000 (UTC)
User-Agent: Thunderbird
X-Accept-Language: pl, en-us, en
In-Reply-To: <e4aqou$t78$1@nemesis.news.tpi.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit