Can anybody help me with this??
Been attempting to use an old nav script to execute a script which should switch the active style sheet of the document. Not the best at JS, so any help would be greatly appreciated.
Many Thanks!!
Script below...
function surfto(form) {
var myindex=form.dest.selectedIndex
if (myindex == "")
{}
else {
// document.location.href = (form.dest.options[myindex].value);
setActiveStyleSheet(form.dest.options[myindex].value);
}
}
function displayColorPreferenceControls(){
/* Check if this will work before displaying controls */
if(navigator.cookieEnabled && document.styleSheets && (document.styleSheets[0].addRule || document.styleSheets[0].insertRule)){
document.write(
"<form id='userColorpref' style='margin-bottom:0px' name='userColorpref'>"+
"<label for='colorChooser'>Theme: </label>"+
"<select name='colorChooser' id='colorChooser' onchange='surfto(this.form)'>"+
"<option value='default'>Default</option>"+
"<option value='highvis'>High Visability</option>"+
"</select>"+
"</form>"
);
}else{
/* if their browser supports JavaScript but not some of the functions or cookies are disabled then you can output alternative content here.*/
document.write('Javascript and Cookies need to be enabled for this functionality');
}
}
Been attempting to use an old nav script to execute a script which should switch the active style sheet of the document. Not the best at JS, so any help would be greatly appreciated.
Many Thanks!!
Script below...
function surfto(form) {
var myindex=form.dest.selectedIndex
if (myindex == "")
{}
else {
// document.location.href = (form.dest.options[myindex].value);
setActiveStyleSheet(form.dest.options[myindex].value);
}
}
function displayColorPreferenceControls(){
/* Check if this will work before displaying controls */
if(navigator.cookieEnabled && document.styleSheets && (document.styleSheets[0].addRule || document.styleSheets[0].insertRule)){
document.write(
"<form id='userColorpref' style='margin-bottom:0px' name='userColorpref'>"+
"<label for='colorChooser'>Theme: </label>"+
"<select name='colorChooser' id='colorChooser' onchange='surfto(this.form)'>"+
"<option value='default'>Default</option>"+
"<option value='highvis'>High Visability</option>"+
"</select>"+
"</form>"
);
}else{
/* if their browser supports JavaScript but not some of the functions or cookies are disabled then you can output alternative content here.*/
document.write('Javascript and Cookies need to be enabled for this functionality');
}
}