HTML+CSS+JS简单实现支付宝付款界面效果

HTML+JS部分

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pay</title>
<link rel="stylesheet" type="text/css" href="pay.css">
<script>
    var password="";
    function clean(){
        if(password.length>0){
          password=password.substr(0,password.length-1);
        }
        for(var i=5;i>=0;i--){
        var pwd=document.form.p[i];
        if(pwd.value!=""){
          pwd.value="";
          break;
        }
      }
    }
    function put(m){
      for(var i=0;i<6;i++){
        var pwd=document.form.p[i];
        if(pwd.value==""){
          pwd.value=m;
          password+=m;
          break;
        }
      }
      if(document.form.p[5].value!=""){
        alert(password);
      }
    }
</script>
</head>
<body>
  <div class="box">
    <div class="logo">
      <img src="1.jpg" class="log"/>
    </div>
    <div class="pay">
      <div class="top">请输入支付密码</div>
      <img src="close.jpg" class="close"/>
      <div class="in">
        <div class="pwd">
        <form name="form">
          <input name="p" type="password" maxlength="1" class="left" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,‘‘);}).call(this)"/>
          <input name="p" type="password" maxlength="1" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,‘‘);}).call(this)"/>
          <input name="p" type="password" maxlength="1" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,‘‘);}).call(this)"/>
          <input name="p" type="password" maxlength="1" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,‘‘);}).call(this)"/>
          <input name="p" type="password" maxlength="1" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,‘‘);}).call(this)"/>
          <input name="p" type="password" maxlength="1" class="right" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,‘‘);}).call(this)"/>
        </form>
          <font style="color:blue;margin-left:186px;line-height: 45px;">忘记密码?</font>
        </div>
      </div>
      <div class="key">
        <table>
            <tr>
              <td onclick="put(1);">1</td>
              <td onclick="put(2);">2</td>
              <td onclick="put(3);">3</td>
            </tr>
            <tr>
              <td onclick="put(4);">4</td>
              <td onclick="put(5);">5</td>
              <td onclick="put(6);">6</td>
            </tr>
            <tr>
              <td onclick="put(7);">7</td>
              <td onclick="put(8);">8</td>
              <td onclick="put(9);">9</td>
            </tr>
            <tr>
              <td style="background: RGB(230,230,230);"></td>
              <td onclick="put(0);">0</td>
              <td style="background: RGB(230,230,230);" onclick="clean();">
                <img src="back.jpg" class="back">
              </td>
            </tr>
        </table>
      </div>
    </div>
  </div>
</body>
</html>

CSS部分

body{
  background: #333;
}
.box{
  width:660px;
  height: 425px;
  background:#fff;
  margin:30px auto;
  border-radius:10px;
}
.logo{
  width:320px;
  height: 325px;
  margin:50px auto;
  position: absolute;
  border-radius:10px;
}
.log{
  width:300px;
  height: 310px;
  position: absolute;
  margin:10px 10px;
  border-radius:10px;
}
.pay{
  width:320px;
  height: 375px;
  background:#fff;
  position: absolute;
  margin:25px 320px;
}
.top{
  width:320px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  background:RGB(247,246,245);
  border-bottom: 1px solid RGB(230,230,230);
}
.close{
  width:25px;
  height:25px;
  float: left;
  margin:-35px 10px;
}
.close:hover{
  width:27px;
  height:27px;
}
.in{
  width:320px;
  height: 130px;
  background:RGB(247,246,245);
}
.pwd{
  width:277px;
  height:46.5px;
  border-radius: 6px;

  position: absolute;
  margin:20px 27px;
}
input{
  width:43px;
  height:43px;
  position: relative;
  margin:-1px -3px;
  background:RGB(245,245,245);
  border:0.5px solid RGB(230,230,230);
  border-top:0.5px solid RGB(200,200,200);
  border-bottom:0.5px solid RGB(200,200,200);
  text-align: center;
  line-height: 43px;
}
.left{
  border-left:0.5px solid RGB(200,200,200);
  border-radius: 3px 0 0 3px;
}
.right{
  border-right:0.5px solid RGB(200,200,200);
  border-radius: 0 3px 3px 0;
}

.key{
  width:320px;
  height: 200px;
}
table{
  width:320px;
  height: 200px;
  border-collapse: collapse;
  border-spacing: 0px;
  border:1px solid RGB(230,230,230);
}
td{
  width: 106.3px;
  height: 45px;
  text-align: center;
  border:1px solid RGB(230,230,230);
  font-size:15px;
  color:#000;
}
td:hover{
  background:RGB(247,246,245);
}
.back{
  width:40px;
  height: 30px;
}
.back:hover{
  width:45px;
  height: 35px;
}

图片资源

效果图

闲出屁来了整了个这玩意,欢迎大家提出宝贵意见!

时间: 2024-08-04 14:11:27

HTML+CSS+JS简单实现支付宝付款界面效果的相关文章

CSS+JS打造的一款flash效果的弹性菜单

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CSS+JS打造的一款flash效果的弹性

js简单的下拉选中效果

css样式: *{ margin:0px auto; padding:0px} #xiala{ width:180px; height:33px; border:1px solid #999;text-align:center; line-height:33px; vertical-align:middle; } #xiala:hover{ cursor:pointer} #zi{width:180px; height:150px; border:1px solid #63C; border-t

html+css+js(+JQuery)制作扑克牌图片切换效果

要实现的效果图: 先把静态页面写出来: index.html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>jquery制作扑克牌图片切换效果<

js+html+css实现简单页面交互功能(2015知乎前端笔试题)http://v.youku.com/v_show/id_XMTI0ODQ5NTAyOA==.html?from=y1.7-1.2

js+html+css实现简单页面交互功能(2015知乎前端笔试题) http://v.youku.com/v_show/id_XMTI0ODQ5NTAyOA==.html?from=y1.7-1.2 密码:hellozhihu

JS CSS 网页 简单 右侧 悬浮

<!--右侧效果--> <script> $().ready(function() { $(".orm").hover(function() { $(this).css("right", "-2px"); }, function() { $(this).css("right", "-175px"); }); }); </script> <div class=&quo

开源组件NanUI一周年 - 使用HTML/CSS/JS来构建.Net Winform应用程序界面

NanUI是什么 NanUI基于ChromiumFX项目进行开发,它能让你在你的Winform应用程序中使用HTML5/CSS3/Javascript等网页技术来呈现用户界面(类似Electron).同时NanUI提供了原生窗口和定制化的无标题栏无边框窗口,你能使用全部的网页技术来设计和呈现你的应用程序界面. 开源方式 NanUI基于MIT协议,所以无论你使用NanUI来开发商业项目或者开源.免费项目都将不受任何限制,只需要遵照协议文件中规定的,在你的软件中声明使用了NanUI技术即可. 系列文

HTML/CSS/JS编码规范

最近整理了一份HTML/CSS/JS编码规范,供大家参考.目录:一.HTML编码规范二.CSS编码规范三.JS编码规范 一.HTML编码规范 1. img标签要写alt属性 根据W3C标准,img标签要写alt属性,如果没有就写一个空的.但是一般要写一个有内容的,根据图片想要表达的意思,因为alt是在图片无法加载时显示的文字.如下不太好的写法: <img src="company-logo.svg" alt="ABC Company Logo"> 更好的

web服务器/cgi/html/css/js

随着Internet技术的兴起,在嵌入式设备的管理与交互中,基于Web方式的应用成为目前的主流,这种程序结构也就是大家非常熟悉的B/S架构,即在嵌入式设备上运行一个支持脚本或CGI功能的Web服务器,能够生成动态页面,在用户端只需要通过Web浏览器就可以对嵌入式设备进行管理和监控,非常方便实用.本节主要介绍这种应用的开发和移植工作. Web 典型的嵌入式Web服务器有Boa (www.boa.org)和thttpd (http://www.acme.com/software/thttpd/)等,

WordPress引入css/js方法总结

WordPress引入css/js方法很多,条件很多.如何全局加载,或仅在某些页面精准加载,什么时候需要先注册脚本再加载,本文希望找到最简单的方式,并给出探索更多方法的途径. 在前台加载css/js 用wp_enqueue_script()函数加载js,用wp_enqueue_style()加载css,加载资源的位置(action)只有一个——wp_enqueue_scripts. 用wp_enqueue_系列函数可以更好的处理脚本样式表的依赖关系,防止重复加载,以twentyfifteen主题