Click to See Complete Forum and Search --> : Changing the CSS via javascript...


J3man
11-16-2003, 12:00 PM
Can anybody help with this problom im having...

i have designed a site for a uni project and i want to make it possible for the admin to change the look of the site online, eg the back ground colour and text colour and style. Is there a way in which i can do this so that it saves it to thee CSS and changes the look of all the site??!

if anybody has any example code it would be much appreicated..


cheers.
Josh.

Jona
11-16-2003, 03:43 PM
Only works for one page, from then on you'll need to use server-requests to invoke the right stylesheet, but you can use onclick="document.getElementById('objectId').className='name_of_class';" or onclick="document.getElementById('objectId').style.backgroundColor='red';" (for example).

[J]ona