秋风的萧瑟 又见湖边木叶飞

欢迎来到梁良 | LonBlog,这里记录下了我生活点点滴滴。

[ZT]用JavaScript修改CSS属性

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>
exmpall
</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<STYLE type="text/css">
div{
padding: 0;
margin: 0;
position: absolute;
left:200px; /*左边*/
top:0;   /*上面*/
display: none;
width: 180px;
height: 150px;
border-style: solid;
border-color: #E6C963;
border-width: thin;
}
</STYLE>
<SCRIPT TYPE="text/javascript">
<!--
function myfunction1()
{
var my=document.getElementById("chenyi");
my.style.position = "absolute";
my.style.top = "50px";   /*上面*/
my.style.display = "inline";
my.style.backgroundColor = "#E4A17C";
}

function myfunction2()
{
var my=document.getElementById("chenyi");
my.style.position = "absolute";
my.style.top = "150px";   /*上面*/
my.style.display = "inline";
my.style.backgroundColor = "#A3935F";
}

function myfunction3()
{
var my=document.getElementById("chenyi");
my.style.position = "absolute";
my.style.top = "200px";   /*上面*/
my.style.display = "inline";
my.style.backgroundColor = "#79851A";
}

function myfunction4()
{
var my=document.getElementById("chenyi");
my.style.position = "absolute";
my.style.top = "300px";   /*上面*/
my.style.display = "inline";
my.style.backgroundColor = "#ACACA9";
}

function myfunction5()
{
var my=document.getElementById("chenyi");
my.style.position = "absolute";
my.style.top = "400px";   /*上面*/
my.style.display = "inline";
my.style.backgroundColor = "#B38DD9";
}
// -->
</SCRIPT>
</head>

<body>
<FORM method="post" action="">
<br /><br />
<INPUT name="text1" type="text" onmouseover="myfunction1()"><br /><br /><br /><br />
<INPUT name="text2" type="text" onmouseover="myfunction2()"><br /><br /><br /><br />
<INPUT name="text3" type="text" onmouseover="myfunction3()"><br /><br /><br /><br />
<INPUT name="text4" type="text" onmouseover="myfunction4()"><br /><br /><br /><br />
<INPUT name="text5" type="text" onmouseover="myfunction5()"><br /><br />
</FORM>
<div id="chenyi">
<ol>
<li><a href="http://hi.baidu.com/515314237/blog">高兴</a></li>
<li>php</li>
<li>asp.net</li>
<li>javaEE</li>
<li>javascript</li>
</ol>
</div>
</body>
</html>

posted on 2010-08-06 22:44 梁良 阅读(576) 评论(0)  编辑  收藏 所属分类: JavaScriptCSS HTML


只有注册用户登录后才能发表评论。


网站导航:
 
<2010年8月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

导航

公告

    欢迎光临

常用链接

随笔分类

随笔档案

相册

.我的网站.

友情博客

开源社区

科技博客

资料网站

最新随笔

搜索

最新评论

阅读排行榜

Powered by:
LonLeung
Copyright © 梁良

本页生成时间:毫秒