首页 > Web开发 > 详细

Js网站开发学习第一天

时间:2017-05-01 15:50:24      阅读:292      评论:0      收藏:0      [点我收藏+]

1、登录时,记住密码单选框,鼠标移上去显示div里的内容,移开则消失;

 1 <head>
 2 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 3     <title></title>
 4     <style type="text/css">
 5         #div1 {
 6             width:100px;
 7             height:50px;
 8             padding:0;
 9             margin:0;
10             background-color:white;
11             border:1px solid;
12             display:none;
13         }
14     </style>
15 </head>
16 <body>
17     <label><input  type="checkbox" onmouseover="document.getElementById(‘div1‘).style.display=‘block‘" onmouseout="document.getElementById(‘div1‘).style.display=‘none‘" />自动登录</label>
18     <div id="div1">
19         将会为您提供新的服务
20     </div>
21 </body>

2、div鼠标移上去自动变颜色,移开后变为原色

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        div{
            width:100px;
            height:100px;
            background-color:blue;
        }
        .box {
            width:200px;
            height:200px;
            background-color :green;
        }
    </style>
</head>
<body>
    <div id="div1" onmouseover="document.getElementById(‘div1‘).className=‘box‘;" onmouseout="document.getElementById(‘div1‘).className=‘‘;">
 </div>
</body>

 

Js网站开发学习第一天

原文:http://www.cnblogs.com/wjr0117/p/6791993.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!