Dreamweaver通俗易懂的常用代码Word文档下载推荐.docx
《Dreamweaver通俗易懂的常用代码Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《Dreamweaver通俗易懂的常用代码Word文档下载推荐.docx(51页珍藏版)》请在冰豆网上搜索。
287"
scrolling="
Auto"
frameborder="
0"
/iframe>
5.iframe自适应高度
pindex"
index.asp"
frameborder=falsescrolling="
auto"
100%"
frameborder=no>
6.IE地址栏前换成自己的图标&
可以在收藏夹中显示出你的图标
linkrel="
ShortcutIcon"
href="
favicon.ico"
Bookmark"
7.字号缩放
越来越多的人长时间的泡网,眼镜的普及率也越来越高,让文字大点,让更多的用户看的更清楚。
scripttype="
text/javascript"
functiondoZoom(size)
{document.getElementById('
zoom'
).style.fontSize=size+'
px'
;
}
/script>
spanid="
zoom"
需要指定大小的文字<
/span>
ahref="
javascript:
doZoom(16)"
大<
/a>
<
doZoom(14)"
中<
doZoom(12)"
小<
8.简单的跳转网页代码
如果你要让页面显示3秒钟之后跳转,可以在html代码的<
head>
/head>
部分加上这样的代码:
metahttp-equiv="
refresh"
content="
3;
url="
9.iframe(嵌入式帧)自适应高度
填写的嵌入地址一定要和本页面在同一个站点上,否则会提示“拒绝访问!
”。
对跨域引用有权限问题,请查阅其他资料。
guestbook"
gbook/index.asp"
scrolling=nowidth="
10.跳转菜单新窗口
selectname="
select"
>
optionvalue="
InternetExplorer<
/option>
"
MicrosoftHome<
DeveloperNetwork<
/select>
11.flash透明选项
paramname="
wmode"
value="
transparent"
12.添加到收藏夹和设为首页
ahref=#>
设为首页<
window.external.AddFavorite('
13.记录并显示网页的最后修改时间
scriptlanguage=JavaScript>
document.write("
最后更新时间:
"
+document.lastModified+"
)
14.节日倒计时
ScriptLanguage="
JavaScript"
vartimedate=newDate("
October1,2002"
);
vartimes="
国庆节"
varnow=newDate();
vardate=timedate.getTime()-now.getTime();
vartime=Math.floor(date/(1000*60*60*24));
if(time>
=0)
document.write("
现在离"
+times+"
还有:
+time+"
天"
/Script>
15.加在HEAD里
禁止缓存
Expires"
CONTENT="
Cache-Control"
no-cache"
Pragma"
16.让IFRAME框架内的文档的背景透明
iframesrc="
about:
bodystyle='
background:
transparent'
allowtransparency>
17.打开窗口即最大化
scriptlanguage="
!
--Beginself.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
//End-->
18.加入背景音乐
bgsoundsrc="
mid/windblue[1].mid"
loop="
-1"
只适用于IE
embedsrc="
music.mid"
autostart="
true"
hidden="
对Netscape,IE都适用
19.滚动
marqueedirection=upheight=146onmouseout=start()onmouseover=stop()scrollAmount=2>
滚动信息
/marquee>
20.防止点击空链接时,页面往往重置到页首端
代码“javascript:
void(null)”代替原来的“#”标记
21.文字或图片弹出指定大小的窗口
在body中加入
type="
text/JavaScript"
functionMM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);
弹出代码
#"
target="
_self"
550"
380"
border="
图片或文字<
22.跳转页面代码
5;
url="
23.细线分隔线
hrnoshadesize=0color=#C0C0C0>
24.网页中的自动换行
tdstyle="
word-break:
break-all"
就搞定了。
完整的是
table-layout:
fixed;
WORD-BREAK:
break-all;
WORD-WRAP:
break-word"
25.消除ie6自动出现的图像工具栏,设置GALLERYIMG属性为false或no.
IMGSRC="
HEIGHT="
100px"
WIDTH="
GALLERYIMG="
26.禁止页面正文内容被选取
bodyoncontextmenu="
returnfalse"
ondragstart="
onselectstart="
onselect="
document.selection.empty()"
oncopy="
onbeforecopy="
27.不能点右键,不用CTRL+A,不能复制作!
window.event.returnValue=false"
onkeypress="
onkeyup="
onselectstart="
event.returnValue=false"
/body>
28.IE浏览器支持一个Body属性bgproperties,它可以让背景不滚动:
BodyBackground="
图片文件"
bgproperties="
fixed"
29.随机变换背景图象(一个可以刷新心情的特效)
image=newArray(4);
//定义image为图片数量的数组
image[0]='
tu0.gif'
//背景图象的路径image[1]='
tu1.gif'
image[2]='
tu2.gif'
image[3]='
tu3.gif'
image[4]='
tu4.gif'
number=Math.floor(Math.random()*image.length);
document.write("
BODYBACKGROUND="
+image[number]+"
30.图片表单按钮
formid="
form1"
name="
method="
post"
action="
imgsrc="
62"
22"
/>
/form>
31.左右阴影背景的CSS定义方法
body{
text-align:
center;
background-repeat:
repeat-y;
background-position:
center;
background-image:
url(../images/bg.jpg);
32.划过链接手型鼠标
cursor:
hand"
33.如何关闭层
divid="
Layer1"
/div>
关闭层<
34.关闭窗口的脚本
ahref=javascript:
close()>
[关闭