百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>网页制作> 网页制作常用代码四
分享文章到:

网页制作常用代码四

发布时间:01/14 来源: 浏览: 关键词:

网页制作常用代码

showModalDialog(sURL [, vArguments] [, sFeatures])
//打开一个模式对话框
//vArguments=需要向新开模式对话框传递的参数
//sFeatures=(*dialogHeight:sHeight;dialogLeft:sXPos;dialogTop:sYPos;dialogWidth:sWidth;center:{ yes | no | 1 | 0 | on | off };dialogHide:{ yes | no | 1 | 0 | on | off };edge:{ sunken | raised };help:{ yes | no | 1 | 0 | on | off };resizable:{ yes | no | 1 | 0 | on | off };scroll:{ yes | no | 1 | 0 | on | off };status:{ yes | no | 1 | 0 | on | off };unadorned:{ yes | no | 1 | 0 | on | off };*)

showModelessDialog(sURL [, vArguments] [, sFeatures])
//打开一个非模式对话框
//vArgument=需要向新开模式对话框传递的参数
//sFeatures=(*dialogHeight:sHeight;dialogLeft:sXPos;dialogTop:sYPos;dialogWidth:sWidth;center:{ yes | no | 1 | 0 | on | off };dialogHide:{ yes | no | 1 | 0 | on | off };edge:{ sunken | raised };help:{ yes | no | 1 | 0 | on | off };resizable:{ yes | no | 1 | 0 | on | off };scroll:{ yes | no | 1 | 0 | on | off };status:{ yes | no | 1 | 0 | on | off };unadorned:{ yes | no | 1 | 0 | on | off };*)
********************************************
execCommand的完全参考(中文版)
document.execCommand(sCommand[,交互方式, 动态参数])

2D-Position;document.execCommand("2D-Position","false","true");使绝对定位的对象可直接拖动;ie5.5
AbsolutePosition;document.execCommand("AbsolutePosition","false","true");使对象定位变成绝对定位;ie5.5
BackColor;document.execCommand("BackColor","false",sColor);设置背景颜色;ie4.0
BlockDirLTR;none;使块级元素排版方式为从左到右?;不支持
BlockDirRTL;none;使块级元素排版方式为从右到左?;不支持 Bold;document.execCommand("Bold","false",null);使选中区域的文字加粗;ie4.0
BrowseMode;none;设置浏览器模式?;不支持 Copy;
document.execCommand("Copy","false",null);复制选中的文字到剪贴板;ie4.0 CreateBookmark;document.execCommand("CreateBookmark","false",sAnchorName);设置指定锚点为书签;ie4.0
CreateLink;document.execCommand("CreateLink","false",sLinkURL);将选中文本变成超连接,若第二个参数为true,会出现参数设置对话框;ie4.0
Cut;document.execCommand("Cut","false",null);剪贴选中的文字到剪贴板;ie4.0
Delete;document.execCommand("Delete","false",null);删除选中的文字;ie4.0
DirLTR;none;排版方式为从左到右?;不支持 DirRTL;none;排版方式为从右到左?;不支持
EditMode;none;设置编辑模式?;不支持
FontName;document.execCommand("FontName","false",sFontName);改变选中区域的字体;ie4.0
FontSize;document.execCommand("FontSize","false",sSize|iSize);改变选中区域的字体大小;ie4.0
ForeColor;document.execCommand("ForeColor","false",sColor);设置前景颜色;ie4.0
FormatBlock;document.execCommand("FormatBlock","false",sTagName);设置当前块的标签名;ie4.0
********************************************
如何把页面加入用户的收藏夹?
<a href="javascript:window.external.AddFavorite('http://','网页教学网脚本')">收藏网页教学网脚本</a>
********************************************
如何让浏览器在保存页面时保存失败?
<NOSCRIPT>
<IFRAME SRC="*.html">
</IFRAME>
</NOSCRIPT>
********************************************
一个页面内所有复选框的全选功能如何实现?
<input type=checkbox><input type=checkbox>
<input type=checkbox><input type=checkbox>
<button onclick=SelectAll()>SelectAll</button>
<script>
function SelectAll()
{
var cInput=document.all.tags('INPUT');
for(var i in cInput)
if(cInput[i].type=='checkbox')cInput[i].checked=true;
}
</script>
********************************************
如何在不刷新页面的情况下刷新css?
<style>
button{ color:#000000;}
</style>
<button onclick=document.styleSheets[0].rules[0].style.color='red'>点击按钮直接修改style标签里button选择符使按钮改为红色</button>

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有6人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板