javascript代码大全(六)

31,在800*600显示器中,如何不让网页水平出现滚动条!  
设至
<body leftmargin="0" topmargin="0">,网页中的表格宽度为778。  
32,关于
<!DOTYPE>的说明解释。  
在网页中,经常会看到〈!DOCTYPE HTML PUBLIC`-//W3C//DTD HTML 4.01//EN`>,是声明HTML文件的版本信息。  
33, 用图片来关闭窗体. 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < href ="java script:window.close()" >< IMG  height =20  width =20  alt ="关闭窗口"  src ="close.gif"  border =0 ></ A >

补充说明:如何使用了ACTIVEX!,不再警告窗口?  

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < html >   
< head >   
< object  id =closes  type ="application/x-oleobject"   
classid
="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >   
< param  name ="Command"  value ="Close" ></ object >   
</ head >   
< body  bgcolor ="#003063"  text ="#ffffff"  id =all >   < href ="#"  onclick ="closes.Click();" > 关闭窗口无提示 </ a >   
</ body >   
</ html >


34,禁止鼠标右键查看网页源代码。  
 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < SCRIPT  language =javascript >   
function  click()  
{
if  (event.button == 2 ) {alert(`你好,欢迎光临!`) }}  
document.onmousedown
= click  
</ SCRIPT >

补充说明:  
鼠标完全被封锁,可以屏蔽鼠标右键和网页文字。  

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> <  body  oncontextmenu ="return false"  ondragstart ="return false"  onselectstart ="return false" >  


35,通过按钮来查看网页源代码。  
 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < input  type ="BUTTON"  value ="查看源代码"  onClick = `window.location = "view-source:"  + window.location.href` name ="BUTTON" >

36,怎么用文字联结实现按钮的SUBMIT功能?  
 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < href ="#"  onclick ="formname.submit()" > OK </ a >

这段文字要放在form里。formname是这里要写在form中的name,<form name=form111>那么就应该是form111.submit()  
37,如何做一个空链接?  
加#  
38,利用
<IFRAME>来给网页中插入网页。  
经常我看到很多网页中又有一个网页,还以为是用了框架,其实不然,是用了
<IFRAME>,它只适用于IE,NS可是不支持<IFRAME>的,但围着的字句只有在浏览器不支援 iframe 标记时才会显示,如<noframes>一样,可以放些提醒字句之类的话。  
你注意啊!下面请和我学习它的用法。  
分析代码:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < iframe  src ="iframe.html"  name ="test"  align ="MIDDLE"  width ="300"  height ="100"  marginwidth ="1"  marginheight ="1"  frameborder ="1"  scrolling ="Yes" >   </ iframe >  
src="iframe.html" 

用来显示<IFRAME>中的网页来源,必要加上相对或绝对路径。  
name="test"  
这是连结标记的 target 参数所需要的。  
align="center"  
可选值为 left, right, top, middle, bottom,作用不大 。  
width="300" height="100"  
框窗的宽及长,以 pixels 为单位。  
marginwidth="1" marginheight="1"  
该插入的文件与框边所保留的空间。  
frameborder="1"  
使用 1 表示显示边框, 0 则不显示。(可以是 yes 或 no)  
scrolling="Yes"  
使用 Yes 表示容许卷动(内定), No 则不容许卷动。  
39,请问<tbody>的用法?  
tbody用法据说是加强对表格的控制能力的.例如:  
<table><tbody>……..</tbody></table>  
tbody代码如果不是你用手写的话,只有在你用IE5打开一个网页的时候, 把它另存为  
一下,你的另存为的文件在表格中就会生成tbody代码。(即便你的表格根本就没有  
tbody代码,IE5另存为的时候也会给你生成)。  
40,Alt和Title都是提示性语言标签,请注意它们之间的区别。  
在我们浏览网页时,当鼠标停留在图片对象或文字链接上时,在鼠标的右下角有时会出现一个提示信息框。对目标进行一定的注释说明。在一些场合,它的作用是很重要的。  
alt 用来给图片来提示的。Title用来给链接文字或普通文字提示的。  
用法如下:  

补充知识:
<TITLE><ALT>里面如何多行换行?在源代码里Enter回车。  
 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < href ="#"  Title ="个人简历  
姓名:张培  
网名:我是闪梦  
性别:男的,不是女的。  
爱好:网页制作,软件开发"
> 个人简历 </ a >

例如:个人简历  
41, 用javascript代码来实现闪烁按钮。  

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < body >   
< form  method ="POST"  action ="--WEBBOT-SELF--" >   
< input  type ="button"  name =SUB  value ="闪烁"  id =flashit  style ="BORDER: 1px solid ;BACKGROUND-COLOR: #FFFFFF" >   
</ form >   
< script >   
if  (document.all && document.all.flashit)  
{  
var  flashelement = document.all.flashit  
if  (flashelement.length == null )  
flashelement[
0 ] = document.all.flashit  
function  changecolor(which)  
{  
if  (flashelement[which].style.color == `# 800000 `)  
flashelement[which].style.color
= " #0063A4 "   
else   
flashelement[which].style.color
= " #800000 "   
}  
if  (flashelement.length == null )  
setInterval(
" changecolor(0) " , 1000 )  
else   
for  (i = 0 ;i < flashelement.length;i ++ )  
{  
var  tempvariable = `setInterval( " changecolor(`+i+`) " ,` + ` 1000 )`  
eval(tempvariable)  
}  
}  
</ script >   
</ body >  


42,CSS给图片定义颜色边框。  
img { border: 1px solid red}  
43,在DW中如何使插入的FLASH透明。  
方法一:选中swf,打开原代码窗口,在
</object>前输入:<param name="wmode" value="transparent">  
方法二:在Flash中的Flie→Publist Settings→HTML→Window Mode选择transparent  
44,在DW编辑文本中,如何输入一个空格呢?  
输入空格的问题,在DW似乎已成了一个老生常谈的问题。通过将输入法调整到全角模式就可以避免了。本以人工智能ABC为例.按Shift+Space切换到全角状态。  
45,为何我的DW中图形显示不正常。  
第一种:可能是因为你定义并正在使用一个site,而你的HTML文件或者图片不在这个site包含的区域之内,因此dreamweaver使用file协议来  
描述图象的绝对路径,可惜IE不支持src中使用file协议,所以图象就显示不出来了。  
第二种:可能是放图片的文件夹或图片名为中文,也显示不到网页中去。  
46,如何在本地机器上测试flash影片的loading?  
我想这可能是很多人在问的题了,其实很简单,在Test时,选选View->Show Streaming就可以看到了。  
47,在网页中做出一根竖的线有几种办法.  
第一种方法:用一个像素图的办法!  
如果你用Dreamwever的Edit→Preferences…→Layout View中的Spacer Image给你创建了一个缺省名为:spacer.gif的一个像素图文件 。  
代码中:  
 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < table  border ="0"  cellspacing ="0"  cellpadding ="0" >   
< tr >   
< td  bgcolor ="#FF0000"  height ="200"   >< img  src ="spacer.gif"  width ="1"  height ="1" ></ td >   
</ tr >   
</ table >

第二种方法:用表格填颜色的办法!把<td> </td>中的 删掉 .  
 

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < table  border ="0"  cellspacing ="0"  cellpadding ="0" >   
< tr >   
< td  bgcolor ="#FF0000"  height ="200"  width ="1" ></ td >   
</ tr >   
</ table >

第三种方法:用水平条。  

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < hr  color ="red"  width ="1"  size ="100%" >  


48, 关于鼠标拖动,改变层大小。──看看微软的做法.  

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < script >   
document.execCommand(
" 2D-position " , false , true );  
</ script >   
< DIV  contentEditable =true >   
< DIV  style ="WIDTH: 300px; POSITION: absolute; HEIGHT: 100px; BACKGROUND-COLOR: red" > 移动层 </ DIV >   
</ DIV >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值