<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font"></select>
<script>
function setFont()
{
var cnt = dlgHelper.fonts.countfor (var i = 1; i < cnt; i++)
{
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}window.onload = setFont;
</script>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font"></select>
<script>
function setFont()
{
var cnt = dlgHelper.fonts.countfor (var i = 1; i < cnt; i++)
{
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}window.onload = setFont;
</script>
</body>
</html>
解决方案 »
- float:left onclick失效 求解 一上午了
- min-height 的不兼容
- [开源项目]JQuery.UI文档库翻译----期待您的加入.
- 取系统上月年月
- 使用js下载服务器图片-出错了 请帮我看看
- 请教一个效果,iframe的,上次问了但没人能够解决,但sohu做到了;我们为什么做不到啊????
- 超连接可以用title显示信息,<a href="tt.htm" title=欢迎进入>进入</a>请问select下拉表单可以吗?如何做?
- 在响应事件时如何得到鼠标的位置?
- 孟子、梅花雨大侠请指教!着急。
- 如何处理让连接地址直接下载
- 紧急求救,如何用把子窗口中列表框的内容用opener方法传回给父窗口的列表框?
- js中如何比较日期大小?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font" onchange="document.body.style.fontFamily=this.value"></select>
<script>
function setFont()
{
var cnt = dlgHelper.fonts.countfor (var i = 1; i < cnt; i++)
{
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}window.onload = setFont;
</script>
通过选择文字来改变网页里所有文字的字体类型 abcdefghijklmnopqrstuvwxyz
</body>
</html>
上面的方法是我一旦选择了字体后,页面的所有文字都变成了那种字体
我的意思是如果有两行文字:
1、文字abc123
2、文字def456我只要求更改文字2的字体,而文字1的字体不受影响。这样我做回复框的目的就可达到了。也就是我在回复框中添加一个字体选项,用户选择的是什么字体,那么该用户在提交后回复以后,页面的就按用户先前选择的字体进行显示。这样,每一段回复的字体就会不一样。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font" onchange="document.all.word2.style.fontFamily=this.value"></select>
<script>
function setFont()
{
var cnt = dlgHelper.fonts.countfor (var i = 1; i < cnt; i++)
{
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}window.onload = setFont;
</script><br>
<span id=word1>字段一 abcdefghijklmnopqrstuvwxyz</span><br>
<span id=word2>字段二 abcdefghijklmnopqrstuvwxyz</span>
</body>
</html>