Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1101662
  • 博文数量: 1310
  • 博客积分: 3980
  • 博客等级: 中校
  • 技术积分: 8005
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-09 22:05
文章分类

全部博文(1310)

文章存档

2011年(1)

2008年(1309)

我的朋友

分类:

2008-11-09 17:40:22



在网上看到了,就摘录下来了,有机会研究下:
<iframe id=x name=x height="100" style="padding:0px;">iframe><br>
<input type=button onclick=t('UnderLine') value="下划线">
<input type=button onclick=t('bold') value="粗体">

<input type=button onclick=t('JustifyLeft') value="左对齐">
<input type=button onclick=t('JustifyCenter') value="居中对齐">
<input type=button onclick=t('JustifyRight') value="右对齐">

<input type=button onclick=t2() value="增高">
<input type=button onclick=t3() value="减少">
<script>
window.frames[
"x"].document.designMode="On"
//setTimeout('window.frames["x"].document.designMode="On"',200)
function t(s)
{
window.frames[
"x"].focus();
o
=window.frames["x"].document.selection.createRange();
window.frames[
"x"].document.execCommand(s);
}

function t2()
{
  
var obj=window.frames["x"].frameElement;
  
var height = parseInt(obj.offsetHeight);
  
if (height+100>=100){
  obj.height
=height+100;
  }
}
function t3()
{
  
var obj=window.frames["x"].frameElement;
  
var height = parseInt(obj.offsetHeight);
  
if (height-100>=100){
  obj.height
=height-100;
  }
}
script>


Yemoo'S JS Blog 2006-06-17 00:22 发表评论
阅读(163) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~