This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > May 2005 > change CSS definition by javascript





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author change CSS definition by javascript
Gerhard Hönig

2005-05-13, 7:26 am

Hi,

i have a basic question on CSS.
Is it possible to change the CSS class definition dynamically by using
Javascript.

example:
ich have a css class like this one:

..test {
color: red;
}

and some HTML tags like

<span class="test">bla bla</span>
...
<span class="test">bla bla</span>
...
<span class="test">bla bla</span>

and now ic would have a link/button to click and then change the color
attribute in class test to blue with Javascript (means without reloading
page and changing it on the server)

is that possible?

thanks.

gerhard


Steve Fulton

2005-05-13, 7:27 pm

Gerhard Hönig wrote:

> i have a basic question on CSS.
> Is it possible to change the CSS class definition dynamically by using
> Javascript.
>
> example:
> ich have a css class like this one:
>
> .test {
> color: red;
> }
>
> and now ic would have a link/button to click and then change the color
> attribute in class test to blue with Javascript (means without reloading
> page and changing it on the server)
>
> is that possible?


Yes. <http://homepages.tesco.net/~J.deBoy...no-answers.html>

--
Steve

Any sufficiently advanced technology is indistinguishable from magic.
-Arthur C Clarke
Matt Silberstein

2005-05-13, 7:27 pm

On Fri, 13 May 2005 08:02:49 -0400, in
comp.infosystems.www.authoring.stylesheets , "Steve Fulton"
<cerberus40@geemail.com> in <op.sqpqej1ii0ix9l@steve> wrote:

>Gerhard Hönig wrote:
>
>
>Yes. <http://homepages.tesco.net/~J.deBoy...no-answers.html>


I am not the OP, but thanks for this link. It should come in two
versions, though. One with a big "YES" and one with a big "NO". Then
you could give one or the other link as the answer.


--
Matt Silberstein

All in all, if I could be any animal, I would want to be
a duck or a goose. They can fly, walk, and swim. Plus,
there there is a certain satisfaction knowing that at the
end of your life you will taste good with an orange sauce
or, in the case of a goose, a chestnut stuffing.
Jean Pierre Daviau

2005-05-18, 7:46 pm

Yes

http://www.dannyg.com/pubs/index.html




"Steve Fulton" <cerberus40@geemail.com> a écrit dans le message de news:
op.sqpqej1ii0ix9l@steve...
| Gerhard Hönig wrote:
|
| > i have a basic question on CSS.
| > Is it possible to change the CSS class definition dynamically by using
| > Javascript.
| >
| > example:
| > ich have a css class like this one:
| >
| > .test {
| > color: red;
| > }
| >
| > and now ic would have a link/button to click and then change the color
| > attribute in class test to blue with Javascript (means without reloading
| > page and changing it on the server)
| >
| > is that possible?
|
| Yes.
<http://homepages.tesco.net/~J.deBoy...no-answers.html>
|
| --
| Steve
|
| Any sufficiently advanced technology is indistinguishable from magic.
| -Arthur C Clarke


Safalra

2005-05-19, 8:04 am

Matt Silberstein wrote:
> <cerberus40@geemail.com> in <op.sqpqej1ii0ix9l@steve> wrote:
<http://homepages.tesco.net/~J.deBoy...ith-yes-or-no-=
answers.html>[color=darkred]
>
> I am not the OP, but thanks for this link.


I doubt the OP will be thanking anyone...

> It should come in two
> versions, though. One with a big "YES" and one with a big "NO". Then
> you could give one or the other link as the answer.


Isn't this more than a little evil? Implicit questions are a major
feature of English (at least in Britain - maybe everyone else is more
direct?) and we'd never get anywhere if people insisted on taking
everything literally...

--
Safalra (Stephen Morley)
http://www.safalra.com/science/linguistics/

Safalra

2005-05-19, 7:27 pm

Gerhard H=F6nig wrote:
> i have a basic question on CSS.
> Is it possible to change the CSS class definition dynamically by

using
> Javascript.


See:

http://www.faqts.com/knowledge_base...id/2147/fid/128

--=20
Safalra (Stephen Morley)
http://www.safalra.com/hypertext/

Gerhard Hönig

2005-05-20, 8:10 am


"Steve Fulton" <cerberus40@geemail.com> wrote in message
news:op.sqpqej1ii0ix9l@steve...
> Gerhard Hönig wrote:
>
>
> Yes.

<http://homepages.tesco.net/~J.deBoy...ith-yes-or-no-a
nswers.html>
>
> --
> Steve
>
> Any sufficiently advanced technology is indistinguishable from magic.
> -Arthur C Clarke


Hi Steve,

thanks lot for this little lesson in english semantics
I'll try to remember ist when perhaps I will find any of yours questions
:-))

gerhard
/o


Gus Richter

2005-05-20, 8:10 am

Gerhard Hönig wrote:
> Hi,
>
> i have a basic question on CSS.
> Is it possible to change the CSS class definition dynamically by using
> Javascript.
>
> and now ic would have a link/button to click and then change the color
> attribute in class test to blue with Javascript (means without reloading
> page and changing it on the server)


See the discussion on "Alternate style sheets" 4/24/05.
You may be interested in my link of an example/demo.
I used onmouseover but onclick may be used if desired.

--
Gus

Japes

2005-05-20, 7:38 pm

A solution is here:

http://www.projectseven.com/extensi...class/index.htm

Great if you use Dreamweaver, very useable, but a little more work if
you dont.

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews