开发者

Dynamically changing typeface / font in web page based on user choice

I know of various ways to dynamically alter web pages' typeface properties via JS/DHTML, or replacing text with Flash-rendered fonts (with sIFR or Cufon). However, I can't find any good examples of dynamically changing the typeface used on a web page depending on user choice - with, for example, the use of a dropdown box or text links开发者_如何学C (to allow the choice of Arial, Helvetica, Lucida Sans and Gill Sans for example).

I'm sure I've seen this functionality in web sites before but I can't find anything written about it, let alone real world examples! Can anybody point out some good examples / proof of concepts / sites that have successfully implemented this feature?


Not sure if this will work, but could you embed a little CSS in the head of your page and then use JavaScript to modify the "font-family" programatically? I've never tried that before so this is just a guess.

<html>
<head>
    <title></title>
    <style type="text/css"> 
        body {
            font-family: Arial, sans-serif;
        }
    </style>
</head>
<body>
    <p>your content...</p>
</body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜