A JavaScript Fancier

伟大的javascript技术研究中...

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  304 随笔 :: 0 文章 :: 479 评论 :: 0 Trackbacks
<2007年10月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

公告

本blog为作者本人学习JS脚本所用,未经特别声明,本站所有文章均属作者本人原创,请转载时注明来源!谢谢合作!同时希望与各位javascript爱好者交流学习。MSN:yanwei8410@hotmail.com

常用链接

留言簿(26)

随笔分类

随笔档案

Ajax技术站点

javascript学习站点

JS高人Blog

Ruby&&Ajax框架

Web技术站点

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜



在网上看到了,就摘录下来了,有机会研究下:
<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>
posted on 2006-06-17 00:22 Yemoo'S JS Blog 阅读(992) 评论(0)  编辑 收藏 引用 所属分类: javascript代码收藏
只有注册用户登录后才能发表评论。
51La