zoukankan      html  css  js  c++  java
  • day12

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    function xianshi(id,xian){
    document.getElementById(id+"span").innerHTML="<font color='red'>"+xian+"</font>";
    }
    function weikong(id,kong){
    var e1=document.getElementById(id).value;
    if(e1==""){
    document.getElementById(id+"span").innerHTML="<font color='#FF0000'>"+kong+"</font>";
    }else{
    document.getElementById(id+"span").innerHTML="";
    }
    }
    </script>
    </head>
    <body>
    <form action="#" method="get" name="regfome" onsubmit="return checkForm()">
    <table height="80px">
    <tr>
    <td width="100px">用户名</td>
    <td><input type="text" name="" id="user" onfocus="xianshi('user','请输入用户名')" onblur="weikong('user','用户名不能为空')" />
    <span id="userspan"></span>
    </td>
    </tr>
    <tr>
    <td>密码</td>
    <td><input type="password" name="" id="password" onfocus="xianshi('password','请输入密码')" onblur="weikong('password','密码不能为空')"/>
    <span id="passwordspan"></span>
    </td>
    </tr>
    <tr>
    <td>密码</td>
    <td><input type="password" name="" id="password"/>
    </td>
    </tr>
    <tr>
    <td><input type="submit" value="注册"/>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    function init(){
    setInterval("lunbo()",300);
    }
    var i=2;
    function lunbo(){
    i++;
    document.getElementById("a").src="img/"+i+".jpg";
    if(i==4){
    i=1;
    }
    }
    </script>
    <style>
    div{
    100px;
    margin: auto;
    }
    </style>
    </head>
    <body onload="init()">
    <div>
    <img src="img/2.jpg"id="a">
    </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title></title>
    <script>
    function init(){
    setInterval("a()",3000);
    }
    i=2;
    function a(){
    i++;
    document.getElementById("lunzhuan").src="img/"+i+".jpg";
    if(i==4){
    i=2;
    }
    }
    </script>
    <style>
    div{
    100px;
    height: 100px;
    margin: auto;
    }
    </style>
    </head>
    <body onload="init()">
    <div>
    <img src="img/2.jpg" style=" 100%;" id="lunzhuan">
    </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    function init(){
    setInterval('a()',2000);
    }
    var i=2;
    function a(){
    i++;
    document.getElementById("a").src="img/"+i+".jpg"
    if(i==4){
    i=1;
    }
    }
    </script>
    </head>
    <body onload="init()">
    <div>
    <img src="img/2.jpg" id="a">
    </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    function init(){
    setInterval('a()',1000);
    t=setInterval('b()',4000);
    }
    var i=2;
    function a(){
    i++;
    document.getElementById("a").src="img/"+i+".jpg";
    if(i==4){
    i=1;
    }
    }
    function b(){
    var c=document.getElementById("b");
    c.style.display="block";
    clearInterval(t)
    t=setInterval('e()',20000);
    }
    function e(){
    document.getElementById("b").style.display="none";
    clearInterval(t);
    }
    </script>
    </head>
    <body onload="init()">
    <div>
    <img src="img/1.jpg" style="display: none;" id="b">
    </div>
    <div>
    <img src="img/2.jpg" id="a">
    </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    function init(){
    setInterval('a()',1000);
    t=setInterval('b()',2000);
    }
    var i=1;
    function a(){
    i++;
    document.getElementById("a").src="img/"+i+".jpg";
    if(i==4){
    i=0;
    }
    }
    function b(){
    var a=document.getElementById("b");
    a.style.display="block";
    clearInterval(t);
    t=setInterval('c()',4000);
    }
    function c(){
    document.getElementById("b").style.display="none";
    }
    </script>
    </head>
    <body onload="init()">
    <img src="img/1.jpg" style="display: none;" id="b">
    <div>
    <img src="img/1.jpg" id="a">
    </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    function init(){
    setInterval('a()',1500);
    t=setInterval('b()',3000);
    }
    var i=1;
    function a(){
    i++;
    document.getElementById("a").src="img/"+i+".jpg";
    if(i==4){
    i=0;
    }
    }
    function b(){
    var c=document.getElementById("b");
    c.style.display="block";
    clearInterval(t);
    t=setInterval('e()',4000);
    }
    function e(){
    document.getElementById("b");
    clearInterval("t")
    }
    function f(id,xian){
    document.getElementById(id+"span").innerHTML="<font color='red'>"+xian+"</font>";
    }
    function f1(id,kong){
    var a=document.getElementById(id).value;
    if(a==""){
    document.getElementById(id+"span").innerHTML="<font color='red'>"+kong+"</font>";

    }else{
    document.getElementById(id+"span").innerHTML="";
    }
    }
    // function bijiao(){
    // var a1=document.getElementsByClassName("e").value;
    // var a2=document.getElementsByClassName("e1").value;
    // if(a1!=a2){}
    // document.getElementById("e1span").innerHTML="<font color='red'>"+"两次密码不相等"+"</font>";
    // }else{
    // document.getElementById("e1span").innerHTML="";
    // }
    </script>
    </head>
    <body onload="init()">
    <img src="img/1.jpg" style="display: none;" id="b">
    <div>
    <img src="img/1.jpg" id="a">
    </div>
    <table>
    <tr>
    <td>用户名<input type="text" id="c" onfocus="f('c','请输入姓名')" onblur="f1('c','姓名不能为空')"/>
    <span id="cspan"></span>
    </td>
    <tr>
    <td>密码<input type="password" class="e" id="e" onfocus="f('e','请输入密码')"onblur="f1('e','密码不能为空')" />
    <span id="espan"></span>
    </td>
    </tr>
    <tr>
    <td>确认密码<input type="password" class="e1" id="e1" onfocus="f('e1','请输入密码')"onblur="f1('e1','密码不能为空')" />
    <span id="e1span"></span>
    </td>
    </tr>
    <tr>
    <td><input type="submit" value="注册"/></td></tr>
    </tr>
    </table>
    </body>
    </html>

  • 相关阅读:
    纯css3实现的超炫checkbox复选框和radio单选框
    css3和jquery实现的可折叠导航菜单(适合手机网页)
    HTML5 Canvas 梦幻的文字飞扬动画教程
    纯css3实现的圆形旋转分享按钮
    纯css3实现的创意图片放大镜
    java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.TextView
    python的range函数与切片操作符
    python简单基础代码
    android笔记 : Content provider内容提供器
    android笔记:Service
  • 原文地址:https://www.cnblogs.com/hfew/p/10520757.html
Copyright © 2011-2022 走看看