DG Kim
07-17-2012, 10:01 PM
Hi,
I have this form:
<select name="font" onchange="updateCSS(1, body, font-family, this.options[this.selectedIndex].value)">
<option value="Calibri, Verdana, Arial, sans-serif">Calibri</option>
<option value="Georgia, 'Times New Roman', Times, serif">Georgia</option>
<option value="'Lucida Sans Unicode', 'Lucida Grande', sans-serif">Lucida Sans</option>
<option value="'Trebuchet MS', Arial, Helvetica, sans-serif">Trebuchet MS</option>
<option value="'Courier New', Courier, monospace">Courier New</option>
</select>
and this updateCSS function:
function updateCSS(style, element, aspect, option){
if(aspect == "background-color"){
$(element).css("background-color", '#'+option);
if(element == "#wrapper" && style == 1){
$("li.row1").css("background-color", '#'+option);
$("li.row2").css("background-color", '#'+option);
}
}
else if(aspect == "background-image"){
$(element).css("background-image", 'url('+option+')');
$(element).css("background-repeat", 'repeat');
}
else{
$(element).css(aspect, option);
}
}
But for some reason it is not auto-updating the font family.... any ideas? :confused:
Best,
DG Kim
I have this form:
<select name="font" onchange="updateCSS(1, body, font-family, this.options[this.selectedIndex].value)">
<option value="Calibri, Verdana, Arial, sans-serif">Calibri</option>
<option value="Georgia, 'Times New Roman', Times, serif">Georgia</option>
<option value="'Lucida Sans Unicode', 'Lucida Grande', sans-serif">Lucida Sans</option>
<option value="'Trebuchet MS', Arial, Helvetica, sans-serif">Trebuchet MS</option>
<option value="'Courier New', Courier, monospace">Courier New</option>
</select>
and this updateCSS function:
function updateCSS(style, element, aspect, option){
if(aspect == "background-color"){
$(element).css("background-color", '#'+option);
if(element == "#wrapper" && style == 1){
$("li.row1").css("background-color", '#'+option);
$("li.row2").css("background-color", '#'+option);
}
}
else if(aspect == "background-image"){
$(element).css("background-image", 'url('+option+')');
$(element).css("background-repeat", 'repeat');
}
else{
$(element).css(aspect, option);
}
}
But for some reason it is not auto-updating the font family.... any ideas? :confused:
Best,
DG Kim