jQuery实现百度登录框的动态切换效果


Posted in jQuery onApril 21, 2017

点击右下角图片进行状态切换,效果图

jQuery实现百度登录框的动态切换效果

jQuery实现百度登录框的动态切换效果

<!doctype html> 
<html lang="en"> 
<head> 
  <meta charset="UTF-8"> 
  <title>百度登录框</title> 
  <style type="text/css"> 
    *{margin: 0;padding: 0;} 
    body 
    { 
      font-size: 12px; 
    } 
    a 
    { 
      text-decoration: none; 
      color: #2647CB; 
    } 
    a:hover 
    { 
      text-decoration: underline; 
      color: red; 
    } 
    .wrap 
    { 
      width: 390px; 
      height: 450px; 
      margin: 50px auto; 
      border: 1px solid #8A8989; 
      position: relative; 
    } 
    .main 
    { 
      width: 350px; 
      height: 400px; 
      margin: 0 auto; 
    } 
    .header 
    { 
      width: 100%; 
      height: 50px; 
      line-height: 50px; 
      background-image: url(images/foot.png); 
      background-color: rgb(247,247,247); 
      background-repeat: no-repeat; 
    } 
    .header h3 
    { 
      display: inline-block; 
      line-height: 50px; 
      margin-left: 50px; 
    } 
    .header span 
    { 
      display: inline-block; 
      float: right; 
      margin: auto 15px; 
      font-size: 30px; 
    } 
    .inputDiv 
    { 
      display: block; 
      width: 350px; 
      height: 40px; 
      margin: 10px auto; 
    } 
    .phoneIn 
    { 
      display: inline-block; 
      float: right; 
      font-size: 14px; 
      background-image: url(images/phone.png); 
      background-repeat: no-repeat; 
      padding-left: 20px; 
      margin: 30px 0px 10px 0px; 
    } 
    .smBtn 
    { 
      background: #2066C5; 
      color: white; 
      font-size: 18px; 
      font-weight: bold; 
      height: 50px; 
      border-radius: 4px; 
    } 
    .smBtn:hover 
    { 
      background: #4067EE; 
    } 
    .pull-right 
    { 
      display: inline-block; 
      float: right; 
    } 
    .other 
    { 
      width: 350px; 
      padding-top: 50px; 
      margin: 0 auto; 
    } 
    .toggleDiv1,.toggleDiv2 
    { 
      position: absolute; 
      right: 0; 
      bottom: 0; 
      z-index: 1000; 
    } 
    .weima 
    { 
      text-align: center; 
      padding-top: 50px; 
      width: 390px; 
      height: 400px; 
    } 
    .weima p  
    { 
      line-height: 50px; 
    } 
    .choice2 
    { 
      display: none; 
    } 
    #close:hover 
    { 
      cursor: pointer; 
      color: blue; 
    } 
  </style> 
</head> 
<body> 
<!-- 账号密码登录 --> 
  <div class="wrap"> 
    <div class="header"> 
      <h3>登录百度账号</h3> 
      <span id="close" title="关闭">X</span> 
    </div> 
    <div class="choice1"> 
      <div class="main"> 
      <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" phoneIn">短信快捷登录</a> 
      <form action=""> 
        <input type="text" class="inputDiv" placeholder="手机/邮箱/账号"> 
        <input type="password" class="inputDiv" placeholder="请输入登录密码"> 
        <p class="inputDiv"> 
        <input type="checkbox" value="checked" checked="checked"><label for="">下次自动登录</label> 
        <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" pull-right" >登录遇到问题</a> 
        </p> 
        <input type="submit" value="登录" class="inputDiv smBtn"> 
        <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" pull-right" >立即注册</a> 
      </form> 
      <div class="other"> 
      <p>可以使用以下方式登录</p> 
      <a href=""><img src=" rel="external nofollow" rel="external nofollow" images/qq.png" alt=""></a> 
      <a href=""><img src=" rel="external nofollow" rel="external nofollow" images/wb.png" alt=""></a> 
      </div> 
    </div> 
    <div class="toggleDiv1"> 
      <img src="images/small2wm.png" alt=""> 
      </div> 
    </div> 
    <!-- 二维码登录 --> 
<div class="choice2"> 
    <div class="weima"> 
    <p>手机扫描,安全登录</p> 
    <img src="images/2weima.png" alt=""> 
    <p>请使用手机百度app扫描登录</p> 
  </div> 
    <div class="toggleDiv2"> 
      <img src="images/cpt.png" alt=""> 
    </div> 
  </div> 
  </div> 
</body> 
<!-- 导入jquery文件 --> 
<script type="text/javascript" src="jquery-3.1.1.min.js"></script> 
<script> 
  $(document).ready(function(){ 
  /*这是一个自定义的函数,作用是设置class1类为隐藏,class2类显示*/ 
     function showDiv(class1,class2){ 
      $(class1).css("display","none"); 
      $(class2).css("display","block"); 
     } 
  /*给右下角的图标设置点击事件*/ 
    $('.toggleDiv1').click(function(){ 
      showDiv(".choice1",".choice2"); 
    }) 
    $('.toggleDiv2').click(function(){ 
      showDiv(".choice2",".choice1"); 
    }) 
  /*给右上角的关闭按钮设置点击事件*/ 
    $("#close").click(function(){ 
      $(".wrap").css("display","none"); 
    }) 
  }) 
</script> 
</html>

以上所述是小编给大家介绍的jQuery实现百度登录框的动态切换效果,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对三水点靠木网站的支持!

jQuery 相关文章推荐
jQuery日程管理控件glDatePicker用法详解
Mar 29 jQuery
jquery鼠标悬停导航下划线滑出效果
Sep 29 jQuery
简单实现jQuery弹窗效果
Oct 30 jQuery
jQuery实现页码跳转式动态数据分页
Dec 31 jQuery
jQuery+Cookie实现切换皮肤功能【附源码下载】
Mar 25 jQuery
深入浅析angular和vue还有jquery的区别
Aug 13 jQuery
jQuery实现基本淡入淡出效果的方法详解
Sep 05 jQuery
jQuery实现的简单日历组件定义与用法示例
Dec 24 jQuery
jquery获取img的src值实例介绍
Jan 16 jQuery
jquery登录的异步验证操作示例
May 09 jQuery
jQuery实现轮播图效果demo
Jan 11 jQuery
JQuery省市联动效果实现过程详解
May 08 jQuery
推荐三款日期选择插件(My97DatePicker、jquery.datepicker、Mobiscroll)
Apr 21 #jQuery
jquery中$.fn和图片滚动效果实现的必备知识总结
Apr 21 #jQuery
jQuery+pjax简单示例汇总
Apr 21 #jQuery
基于jQuery实现文字打印动态效果
Apr 21 #jQuery
jQuery插件FusionCharts绘制的3D双柱状图效果示例【附demo源码】
Apr 20 #jQuery
jquery将标签元素的高设为屏幕的百分比
Apr 19 #jQuery
jQuery Plupload上传插件的使用
Apr 19 #jQuery
You might like
PHP函数常用用法小结
2010/02/08 PHP
yii框架源码分析之创建controller代码
2011/06/28 PHP
PHP身份证校验码计算方法
2016/08/10 PHP
Dom加载让图片加载完再执行的脚本代码
2008/05/15 Javascript
jquery isType() 类型判断代码
2011/02/14 Javascript
javascript分页代码(当前页码居中)
2012/09/20 Javascript
JQuery触发radio或checkbox的change事件
2012/12/18 Javascript
jQuery选择器简明总结(含用法实例,一目了然)
2014/04/25 Javascript
jquery中map函数与each函数的区别实例介绍
2014/06/23 Javascript
JavaScript里四舍五入函数round用法实例
2015/04/06 Javascript
如何根据百度地图计算出两地之间的驾驶距离(两种语言js和C#)
2015/10/29 Javascript
jQuery模拟淘宝购物车功能
2017/02/27 Javascript
jquery实现图片平滑滚动详解
2017/03/22 jQuery
微信小程序中顶部导航栏的实现代码
2017/03/30 Javascript
ionic2打包android时gradle无法下载的解决方法
2017/04/05 Javascript
Bootstrap滚动监听组件scrollspy.js使用方法详解
2017/07/20 Javascript
JS库之Waypoints的用法详解
2017/09/13 Javascript
vue2.0开发入门笔记之.vue文件的生成和使用
2017/09/19 Javascript
JavaScript惰性求值的一种实现方法示例
2019/01/11 Javascript
详解node和ES6的模块导出与导入
2020/02/19 Javascript
javascript实现简易计算器功能
2020/09/23 Javascript
实例解析Python设计模式编程之桥接模式的运用
2016/03/02 Python
使用pandas对矢量化数据进行替换处理的方法
2018/04/11 Python
python 对txt中每行内容进行批量替换的方法
2018/07/11 Python
Python爬取成语接龙类网站
2018/10/19 Python
python3 实现的对象与json相互转换操作示例
2019/08/17 Python
Python实现线性判别分析(LDA)的MATLAB方式
2019/12/09 Python
Python依赖包迁移到断网环境操作
2020/07/13 Python
Python colormap库的安装和使用详情
2020/10/06 Python
HTML5 Canvas旋转动画的2个代码例子(一个旋转的太极图效果)
2014/04/10 HTML / CSS
受欢迎的大学生自我评价
2013/12/05 职场文书
大学生求职信
2014/06/17 职场文书
车辆转让协议书
2014/09/24 职场文书
区政府领导班子个人对照检查材料
2014/09/25 职场文书
护士节慰问信
2015/02/15 职场文书
李强感恩观后感
2015/06/17 职场文书