DHTML工具栏,Web点击更精彩(5)
来源:互联网 发布:dijkstra算法堆优化 编辑:程序博客网 时间:2024/04/30 00:55
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
由于BUTTON是“控件“,它们是作为迷你文档而存在的,因此所包含的HTML被包装在它们的边界线内,并在普通的HTML流以外。现在我们尝试来重新创建Internet Explorer工具栏的一部分,在 DHTML 中使用 BUTTON、图形和文本。请先点击这里看看其中的效果图1。
要创建上面看过的图1所示的工具栏,使用以下HTML和脚本:
< HTML>
< HEAD>
< STYLE TYPE="text/css">
.but {
border:1px buttonface solid;
font-family:MS Sans Serif;font-size:8pt;
}
< /STYLE>
.
.
.
< /HEAD>
< BODY>
.
.
.
< DIV ID="toolbar" NOWRAP
STYLE="width:20;background-color:buttonface;padding:2px;">
< BUTTON CLASS=but>
onClick="yourStopFunction()"< IMG
SRC="StopOff.gif" WIDTH=19 HEIGHT=20 BORDER=0>< BR>
Stop< /BUTTON>< BUTTON CLASS=but
onClick="yourRefreshFunction()">< IMG
SRC="RefreshOff.gif" WIDTH=17 HEIGHT=20 BORDER=0>< BR>
Refresh< /BUTTON>< BUTTON CLASS=but
onClick="yourHomeFunction()">< IMG
SRC="HomeOff.gif" WIDTH=19 HEIGHT=20 BORDER=0>< BR>
Home< /BUTTON>< BUTTON CLASS=but
onClick="yourSearchFunction()">< IMG
SRC="SearchOff.gif" WIDTH=20 HEIGHT=20 BORDER=0>< BR>
Search< /BUTTON>< BUTTON CLASS=but
onClick="yourFavoritesFunction()">< IMG
SRC="FavoritesOff.gif" WIDTH=20 HEIGHT=20 BORDER=0>< BR>
Favorites< /BUTTON>< BUTTON CLASS=but
onClick="yourHistoryFunction()">< IMG
SRC="HistoryOff.gif" WIDTH=20 HEIGHT=20 BORDER=0>< BR>
History< /BUTTON>
< /DIV>
.
.
.
< SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
allBUTs = toolbar.children;
for (i=0;i< allBUTs.length;i++) {
tSpan = allBUTs(i);
tSpan.onselectstart = function(){return false}
tSpan.onmouseover = function(){
this.style.border = "1px buttonhighlight outset";
}
tSpan.onmouseout = function(){
this.style.border = "1px buttonface solid";
}
tSpan.onmousedown = function(){
this.style.border = "1px buttonhighlight inset";
}
tSpan.onmouseup = function(){
this.style.border = "1px buttonhighlight outset";
window.focus();
}
}
< /SCRIPT>>
< /BODY>
< /HTML>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原因之4—更好地利用图形由于BUTTON是“控件“,它们是作为迷你文档而存在的,因此所包含的HTML被包装在它们的边界线内,并在普通的HTML流以外。现在我们尝试来重新创建Internet Explorer工具栏的一部分,在 DHTML 中使用 BUTTON、图形和文本。请先点击这里看看其中的效果图1。
要创建上面看过的图1所示的工具栏,使用以下HTML和脚本:
< HTML>
< HEAD>
< STYLE TYPE="text/css">
.but {
border:1px buttonface solid;
font-family:MS Sans Serif;font-size:8pt;
}
< /STYLE>
.
.
.
< /HEAD>
< BODY>
.
.
.
< DIV ID="toolbar" NOWRAP
STYLE="width:20;background-color:buttonface;padding:2px;">
< BUTTON CLASS=but>
onClick="yourStopFunction()"< IMG
SRC="StopOff.gif" WIDTH=19 HEIGHT=20 BORDER=0>< BR>
Stop< /BUTTON>< BUTTON CLASS=but
onClick="yourRefreshFunction()">< IMG
SRC="RefreshOff.gif" WIDTH=17 HEIGHT=20 BORDER=0>< BR>
Refresh< /BUTTON>< BUTTON CLASS=but
onClick="yourHomeFunction()">< IMG
SRC="HomeOff.gif" WIDTH=19 HEIGHT=20 BORDER=0>< BR>
Home< /BUTTON>< BUTTON CLASS=but
onClick="yourSearchFunction()">< IMG
SRC="SearchOff.gif" WIDTH=20 HEIGHT=20 BORDER=0>< BR>
Search< /BUTTON>< BUTTON CLASS=but
onClick="yourFavoritesFunction()">< IMG
SRC="FavoritesOff.gif" WIDTH=20 HEIGHT=20 BORDER=0>< BR>
Favorites< /BUTTON>< BUTTON CLASS=but
onClick="yourHistoryFunction()">< IMG
SRC="HistoryOff.gif" WIDTH=20 HEIGHT=20 BORDER=0>< BR>
History< /BUTTON>
< /DIV>
.
.
.
< SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
allBUTs = toolbar.children;
for (i=0;i< allBUTs.length;i++) {
tSpan = allBUTs(i);
tSpan.onselectstart = function(){return false}
tSpan.onmouseover = function(){
this.style.border = "1px buttonhighlight outset";
}
tSpan.onmouseout = function(){
this.style.border = "1px buttonface solid";
}
tSpan.onmousedown = function(){
this.style.border = "1px buttonhighlight inset";
}
tSpan.onmouseup = function(){
this.style.border = "1px buttonhighlight outset";
window.focus();
}
}
< /SCRIPT>>
< /BODY>
< /HTML>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- DHTML工具栏,Web点击更精彩(5)
- DHTML工具栏,Web点击更精彩(1)
- DHTML工具栏,Web点击更精彩(6)
- DHTML工具栏,Web点击更精彩(7)
- DHTML工具栏,Web点击更精彩(8
- DHTML工具栏,Web点击更精彩(3)--工具栏的行为
- DHTML工具栏,Web点击更精彩(4)--使用按钮
- DHTML工具栏,Web点击更精彩(2)--简单的文本
- 【孟宪会之精彩世界】DHtml精彩放送
- DHTML设计VC界面《三》- Toolbar工具栏
- 有我更精彩
- 有你更精彩
- DHTML Hierarchical Web Tab
- 点击工具栏弹出页面
- 生活有你更精彩
- Dhtml+Js算法:5个小球运动的简化版,变通实现更简单的飞行的图片
- DHTML【5】--HTML
- DHTML
- 用JDOGenie进行基于JDO的项目开发向导
- 使用JavaScript创建智能表单
- 提升数据访问层的性能(1)
- 怎样把Java Applet嵌入HTML
- 提升数据访问层的性能(2)
- DHTML工具栏,Web点击更精彩(5)
- Java程序员的存储过程
- javascript的键盘控制事件
- JDBC学习笔记(保持更新)
- JavaScript 的数据类型
- 关于PreparedStatement接口的一个测试
- Java技巧(一):会变色的超链接
- Interview: Emmanuel Bernard on the Bean Validation specification
- 第一个JDBC程序