Click to See Complete Forum and Search --> : CSS help


slam2004
12-12-2003, 07:37 AM
Hello

First time post, need some help, total newbie but heres what I need:

Javascript code that will change an external style sheet so that the main text of the page can be changed to large or small text by clicking on two radio buttons named 'enlarge' and 'reduce'. The example function i was give is down below but how do I get the bloody thing to work???

function enlarge(){
document.getElementById("csslink").href = "dom_acc.css";
}
function reduce(){
document.getElementById("csslink").href = "dom.css";
}

Help!
Cheers

lcscne
12-12-2003, 07:42 AM
I don't think this is possible. The page needs to be reloaded after the link href has been changed. Simply changing the href isn't going to automatically implement the new style sheet without a page reload.

fredmv
12-12-2003, 02:04 PM
It's completely possible. See attachment.

slam2004
12-15-2003, 09:15 AM
thanks fred!!! Works a treat :D

fredmv
12-15-2003, 11:52 AM
You're quite welcome. :D