书签 分享 收藏 举报 版权申诉 / 48

类型html代码大全 很全.docx

  • 文档编号:3231913
  • 上传时间:2023-05-05
  • 格式:DOCX
  • 页数:48
  • 大小:39.97KB

 

absolute;top:

50;width:

200px;

 height:

115px;z-index:

1">

 

 

13。

返回上一页

 

history.back

(1)>『返回上一页』

14。

关闭窗口

 

self.close()>『关闭窗口』

15。

关于iframe的透明背景

 

 allowTransparency="true"

 style="background-color:

green">

16.oncontextmenu="window.event.returnValue=false"将彻底屏蔽鼠标右键

no可用于Table

17.取消选取、防止复制

18.onpaste="returnfalse"不准粘贴

19.oncopy="returnfalse;"oncut="returnfalse;"防止复制

20.IE地址栏前换成自己的图标

21.可以在收藏夹中显示出你的图标

22.

disabled">关闭输入法

23.永远都会带着框架

--

if(window==top)top.location.href="frames.htm";//frames.htm为框架网页

//-->

24.防止被人frame

--

if(top.location!

=self.location)top.location=self.location;

//-->

25.网页将不能被另存为

26.查看网页源代码

"+""">

27.删除时确认

if(confirm("确实要删除吗?

"))location="boos.asp?

&areyou=删除&page=1"">删除

28.屏蔽功能键Shift,Alt,Ctrl

29.网页不会被缓存

21:

57GMT">

或者

30.怎样让表单没有凹凸感?

1solid#000000">

none;border-right:

none;border-top:

none;border-bottom:

1solid#000000">

31.不要滚动条?

让竖条没有:

scroll;overflow-y:

hidden">

让横条没有:

scroll;overflow-x:

hidden">

两个都去掉?

更简单了

32.怎样去掉图片链接点击后,图片周围的虚线?

33.电子邮件处理提交表单

34.在打开的子窗口刷新父窗口的代码里如何写?

window.opener.location.reload()

35.如何设定打开页面的大小

打开页面的位置

36.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动

37.检查一段字符串是否全由数字组成

--

functioncheckNum(str){returnstr.match(//D/)==null}

alert(checkNum("1232142141"))

alert(checkNum("123214214a1"))

//-->

38.获得一个窗口的大小

document.body.clientWidth;document.body.clientHeight

39.怎么判断是否是字符

if(/[^/x00-/xff]/g.test(s))alert("含有汉字");

elsealert("全是字符");

40.TEXTAREA自适应文字行数的多少

41.日期减去天数等于第二个日期

functioncc(dd,dadd)

{

//可以加上错误处理

vara=newDate(dd)

a=a.valueOf()

a=a-dadd*24*60*60*1000

a=newDate(a)

alert(a.getFullYear()+"年"+(a.getMonth()+1)+"月"+a.getDate()+"日")

}cc("12/23/2002",2)

42.选择了哪一个Radio

functioncheckme()

foreachobinradio1

ifob.checkedthenwindow.alertob.value

next

endfunction

Style

Barcode

43.脚本永不出错

--HidefunctionkillErrors(){returntrue;}window.onerror=killErrors;//-->

44.ENTER键可以让光标移到下一个输入框

45.检测某个网站的链接速度:

把如下代码加入区域中:

tim=1

setInterval("tim++",100)

b=1

varautourl=newArray()

autourl[1]=""

autourl[2]=""

autourl[3]=""

autourl[4]=""

autourl[5]=""

functionbutt(){

document.write("")

for(vari=1;i

document.write("

……>=》

name=url"+i+"size=40>=》

onclick=window.open(this.form.url"+i+".value)>
")

document.write("")

}

butt()

functionauto(url){

document.forms[0]["url"+b].value=url

if(tim>200)

{document.forms[0]["txt"+b].value="链接超时"}

else

{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}b++}

functionrun(){for(vari=1;i

//"+autourl+"/"+Math.random()+"width=1height=1nerror=auto("http:

//"+autourl+"")>")}

run()

46.各种样式的光标

auto:

标准光标

default:

标准箭头

hand:

手形光标

wait:

等待光标

text:

I形光标

vertical-text:

水平I形光标

no-drop:

不可拖动光标

not-allowed:

无效光标

help:

?

帮助光标

all-scroll:

三角方向标

move:

移动标

crosshair:

十字标

e-resize

n-resize

nw-resize

w-resize

s-resize

se-resize

sw-resize

47、禁止鼠标右键,把Demo的图片全都设为表格的背景,表格的大小与图片的大小一样。

这样做看起来是一样的,主要是防止鼠标经过图片时会出现另存的按钮。

禁止鼠标右键的代码很简单:

functionclick(){if(event.button==2)

{alert(呵呵,不好意思,你甭想使用右键下载图片:

));}}document.onmousedown=click

48、在网页的Head部分加入如下代码,这段代码的主要功能是屏蔽PrintScreen键,不断清空剪贴版,防止图片被用文件——另存为菜单另存。

--

functiontestclip(){

try{

if(clipboardData.getData("Text")||clipboardData.getData("HTML")||clipboardData.getData("URL"))

{

null;

}

}

catch(e){

clipboardData.setData("Text","")

}

setTimeout("testclip()",500)

}

testclip();

//-->

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

1.将彻底屏蔽鼠标

配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
html代码大全 很全 html 代码 大全
提示  冰点文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:html代码大全 很全.docx
链接地址:https://www.bingdoc.com/p-3231913.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2


收起
展开