关于js和div的简单应用
2011-01-13 11:25
363 查看
第一部分
------------------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>JS测试</title>
</head>
<style>
body{
padding:0;
spacing:0;
}
#top{
width:800px;
height:50px;
background-color:#336699;
display:block;
}
#content{
spacing-top:1px;
width:800px;
height:200px;
background-color:#336699;
}
#foot{
width:800px;
height:200px;
background-color:green;
border:1 solid red;
}
</style>
<script language="javascript">
function mo(){
document.getElementById('content').style.visibility="hidden";
}
function no(){
document.getElementById('content').style.visibility="visible";
}
function mo1(){
document.getElementById('top').style.display="none";
document.getElementById('content').style.background="yellow";
}
function no1(){
document.getElementById('top').style.display="block";
document.getElementById('content').style.background="#336699";
}
function con(){
document.getElementById('foot').innerHTML='<font color="red">这个世界很美好!</font><br><input type="text" value="你是个好人" />';
}
</script>
<body>
<div id="top" onmouseover="mo1();" onmouseout="no1();">
这是头部
</div>
<div id="content" onmouseover="mo();" onmouseout="no();">
这是内容部分<BR>
</div>
<div id="foot" onmouseover="con();">
foot
</div>
</body>
</html>
第二部分
----------------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>JS测试</title>
</head>
<style>
#top{
width:800px;
height:50px;
background-color:#336699;
display:block;
}
#foot{
width:800px;
height:100px;
border:1 solid blue;
text-align:center;
}
</style>
<script language="javascript">
function mo1(){
document.getElementById('top').style.background="red";
}
function no1(){
document.getElementById('top').style.background="#336699";
}
function getHTML(){
var setHTML = document.getElementById('top').innerHTML;
document.getElementById('foot').innerHTML = setHTML;
}
</script>
<body>
<div id="top" onmouseover="mo1();" onmouseout="no1();">
这是头部,你好!
</div>
<div id="foot">
<button onclick="getHTML();">内容</button>
</div>
</body>
</html>
第三部分
------------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>页面内容不能被复制</title>
</head>
<style>
@media print{
body{
display:none;
}
}
</style>
<body oncontextmenu="return false"
ondragstart="return false"
onselectstart="return false"
onselect="document.selection.empty()"
oncopy="document.selection.empty()"
onbeforecopy="return false"
onmouseup="document.selection.empty()">
好好学习,天天向上!
</body>
</html>
------------------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>JS测试</title>
</head>
<style>
body{
padding:0;
spacing:0;
}
#top{
width:800px;
height:50px;
background-color:#336699;
display:block;
}
#content{
spacing-top:1px;
width:800px;
height:200px;
background-color:#336699;
}
#foot{
width:800px;
height:200px;
background-color:green;
border:1 solid red;
}
</style>
<script language="javascript">
function mo(){
document.getElementById('content').style.visibility="hidden";
}
function no(){
document.getElementById('content').style.visibility="visible";
}
function mo1(){
document.getElementById('top').style.display="none";
document.getElementById('content').style.background="yellow";
}
function no1(){
document.getElementById('top').style.display="block";
document.getElementById('content').style.background="#336699";
}
function con(){
document.getElementById('foot').innerHTML='<font color="red">这个世界很美好!</font><br><input type="text" value="你是个好人" />';
}
</script>
<body>
<div id="top" onmouseover="mo1();" onmouseout="no1();">
这是头部
</div>
<div id="content" onmouseover="mo();" onmouseout="no();">
这是内容部分<BR>
</div>
<div id="foot" onmouseover="con();">
foot
</div>
</body>
</html>
第二部分
----------------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>JS测试</title>
</head>
<style>
#top{
width:800px;
height:50px;
background-color:#336699;
display:block;
}
#foot{
width:800px;
height:100px;
border:1 solid blue;
text-align:center;
}
</style>
<script language="javascript">
function mo1(){
document.getElementById('top').style.background="red";
}
function no1(){
document.getElementById('top').style.background="#336699";
}
function getHTML(){
var setHTML = document.getElementById('top').innerHTML;
document.getElementById('foot').innerHTML = setHTML;
}
</script>
<body>
<div id="top" onmouseover="mo1();" onmouseout="no1();">
这是头部,你好!
</div>
<div id="foot">
<button onclick="getHTML();">内容</button>
</div>
</body>
</html>
第三部分
------------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>页面内容不能被复制</title>
</head>
<style>
@media print{
body{
display:none;
}
}
</style>
<body oncontextmenu="return false"
ondragstart="return false"
onselectstart="return false"
onselect="document.selection.empty()"
oncopy="document.selection.empty()"
onbeforecopy="return false"
onmouseup="document.selection.empty()">
好好学习,天天向上!
</body>
</html>
相关文章推荐
- 毕业设计(十九)---文章模块管理 div弹出层的应用 简单js操作
- 简单的弹出层窗口应用(DIV+JS)
- 毕业设计(十九)---文章模块管理 div弹出层的应用 简单js操作
- 关于android Service服务的一些简单应用
- 关于GridView中自定义分页、单选、多选、排序、自增列的简单应用
- js实现DIV的一些简单控制
- 关于div自适应高度/左右高度自适应一致的js代码
- 在Node.js应用中读写Redis数据库的简单方法
- 关于js中alert弹出窗口文本换行问题简单详细说明
- 关于解决JS中方法名重复问题的简单办法
- nw.js node-webkit系列(1)简单介绍及应用
- iOS UIwebview关于图片文字的简单js交互
- for循环的简单应用-自动生成div
- NodeJs session中间件 及应用(简单的登录与登出)
- Ext.js 组件的简单应用——【Window】和【HtmlEditor】结合使用
- JS之——回调函数的简单应用(插曲)
- 关于迭代的简单应用:查看文件夹的路径
- 关于VS2005中GridView的自定义分页,单选、多选、排序、自增列的简单应用。
- 关于mui Div模式选项卡 JS主动触发切换指定选项卡
- 关于js中call和apply函数的应用