<b>Dreamweaver常用代码</b>[DW设计]
本文“<b>Dreamweaver常用代码</b>[DW设计]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
1.掌握横向和纵向转动条的显隐?
<body style="overflow-y:hidden"> 去掉x轴
<body style="overflow-x:hidden"> 去掉y轴
<body scroll="no">不显
--------------------------------------------------------------------------------
2.表格变色
<TD
style="CURSOR: hand">
--------------------------------------------------------------------------------
3.禁止复制,鼠标拖动选取
<body ondragstart=window.event.returnValue=false oncontextmenu=window.event.returnValue=false onselectstart=event.returnValue=false>
--------------------------------------------------------------------------------
4.普通iframe页面
<iframe name="name" src="main.htm" width="450" height="287" scrolling="Auto" frameborder="0"></iframe>
--------------------------------------------------------------------------------
5.iframe自适应高度
<iframe name="pindex" src="index.asp" frameborder=false scrolling="auto" width="100%" height="100%" frameborder=no ></iframe>
--------------------------------------------------------------------------------
6.IE地址栏前换成自己的图标&可以在珍藏夹中显示出你的图标
<link rel="Shortcut Icon" href="favicon.ico">
<link rel="Bookmark" href="favicon.ico">
--------------------------------------------------------------------------------
7.字号缩放
越来越多的人长时间的泡网,眼镜的遍及率也越来越高,让文字大点,让更多的用户看的更清楚.
<script type="text/javascript">
function doZoom(size)
{document.getElementById('zoom').style.fontSize=size+'px';}
</script>
<span id="zoom">需求指定大小的文字</span>
<a href="javascript:doZoom(16)">大</a> <a href="javascript:doZoom(14)">中</a> <a href="javascript:doZoom(12)">小</a>
--------------------------------------------------------------------------------
8.简单的跳转代码
假如你要让页面显示3秒钟之后跳转,可以在html代码的<head></head>部份加上这样的代码:
<meta http-equiv="refresh" content="3; url=http://www.devdao.com">
--------------------------------------------------------------------------------
9.iframe(嵌入式帧)自适应高度
填写的嵌入地址一定要和本页面在同一个站点上,不然会提醒“回绝拜候!”.对跨域引用有权限问题,请查阅其他资料.
<iframe name="guestbook" src="gbook/index.asp" scrolling=no width="100%" height="100%" frameborder=no ></iframe>
--------------------------------------------------------------------------------
10.跳转菜单新窗口
<select name="select" >
<option value="http://www.microsoft.com/ie"> Internet Explorer</option>
<option value="http://www.microsoft.com"> Microsoft Home</option>
<option value="http://msdn.microsoft.com"> Developer Network</option>
</select>
--------------------------------------------------------------------------------
11.flash透明选项
<param name="wmode" value="transparent">
--------------------------------------------------------------------------------
12.增添到珍藏夹和设为首页
<a href=# >设为首页</a>
<a href="javascript:window.external.AddFavorite('http://www.devdao.com/','网')">珍藏本站</a>
--------------------------------------------------------------------------------
13.记录并显示的最后改正时间
<script language=JavaScript>
document.write("最后更新时间: " + document.lastModified + "")
</script>
--------------------------------------------------------------------------------
14.节日倒计时
<Script Language="JavaScript">
var timedate= new Date("October 1,2002");
var times= "国庆节";
var now = new Date();
var date = timedate.getTime() - now.getTime();
var time = Math.floor(date / (1000 * 60 * 60 * 24));
if (time >= 0)
document.write( "目前离"+times+"还有: "+time +"天")
</Script>
--------------------------------------------------------------------------------
15.加在HEAD里
禁止缓存
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
--------------------------------------------------------------------------------
16.让IFRAME框架内的文档的后台透明
<iframe src="about:<body style='background:transparent'>" allowtransparency></iframe>
--------------------------------------------------------------------------------
17.翻开窗口即最大化
<script language="JavaScript">
<!-- Begin
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
// End -->
</script>
--------------------------------------------------------------------------------
18.加入后台音乐
<bgsound src="mid/windblue[1].mid" loop="-1"> 只实用于IE
<embed src="music.mid" autostart="true" loop="true" hidden="true"> 对Netscape ,IE 都实用
--------------------------------------------------------------------------------
19.转动
<marquee direction=up height=146 onmou搜索引擎优化ut=start() onmou搜索引擎优化ver=stop() scrollAmount=2>转动信息
</marquee>
--------------------------------------------------------------------------------
20.避免点击空链接时,页面常常重置到页首端
代码“javascript:void(null)”替换本来的“#”标志
--------------------------------------------------------------------------------
21.文字或图片弹出指定大小的窗口
在body中加入
<script language="JavaScript" type="text/JavaScript">
function MM_openBrWindow(theURL,winName,features) {window.open(theURL,winName,features);}
</script>
弹出代码
<a href="#" target="_self" width="550" height="380" border="0">图片
以上是“<b>Dreamweaver常用代码</b>[DW设计]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |