jQuery实现百度登录框的动态切换效果
更新时间:2017年4月27日 10:00 点击:1750
点击右下角图片进行状态切换,效果图
<!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实现加载更多"转圈圈"效果,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2020-11-10
- 最近接了一个项目,其中有需求要用到jquery分页控件,上网也找到了需要分页控件,各种写法各种用法,都是很复杂,最终决定自己动手写一个jquery分页控件,全当是练练手了。写的不好,还请见谅,本分页控件在chrome测试过,其他的兼容性...2015-10-30
- 有时我们在页面上需要选择数值范围,如购物时选取价格区间,购买主机时自主选取CPU,内存大小配置等,使用直观的滑块条直接选取想要的数值大小即可,无需手动输入数值,操作简单又方便。HTML首先载入jQuery库文件以及jRange相关...2015-03-15
- 本文实例讲述了jQuery实现非常实用漂亮的select下拉菜单选择效果。分享给大家供大家参考,具体如下:先来看如下运行效果截图:在线演示地址如下:http://demo.jb51.net/js/2015/js-select-chose-style-menu-codes/具体代码如...2015-11-08
- 本文实例讲述了jquery实现的伪分页效果代码。分享给大家供大家参考,具体如下:这里介绍的jquery伪分页效果,在火狐下表现完美,IE全系列下有些问题,引入了jQuery1.7.2插件,代码里有丰富的注释,相信对学习jQuery有不小的帮助,期...2015-10-30
- JQuery使我们在开发Ajax应用程序的时候提高了效率,减少了许多兼容性问题,我们在Ajax项目中,遇到ajax异步获取数据出错怎么办,我们可以通过捕捉error事件来获取出错的信息。在没给大家介绍正文之前先给分享Jquery中AJAX参...2015-11-24
- 拜读一个开源框架,最想学到的就是设计的思想和实现的技巧。废话不多说,jquery这么多年了分析都写烂了,老早以前就拜读过,不过这几年都是做移动端,一直御用zepto, 最近抽出点时间把jquery又给扫一遍我也不会照本宣科的翻译...2014-05-31
- 当页面打开时我们需要执行一些操作,这个时候如果我们选择使用jquery的话,需要重写他的3中方法,自我感觉没什么区 别,看个人喜好了,第二种感觉比较简单明了: 第一种: 复制代码 代码如下: <script type="text/javas...2014-06-07
jquery中常用的SET和GET$(”#msg”).html循环介绍
复制代码 代码如下: $(”#msg”).html(); //返回id为msg的元素节点的html内容。 $(”#msg”).html(”new content“); //将“new content” 作为html串写入id为msg的元素节点内容中,页面显示粗体的new content $(”...2013-10-13- jquery中jquery.offset().top / left用于获取div距离窗口的距离,jquery.position().top / left 用于获取距离父级div的距离(必须是绝对定位的div)。 (1)先介绍jquery.offset().top / left css: 复制代码 代码如下: *{ mar...2013-10-13
- 这篇文章主要为大家详细介绍了jQuery实现广告显示和隐藏动画,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-07-05
jQuery Mobile开发中日期插件Mobiscroll使用说明
这篇文章主要介绍了jQuery Mobile开发中日期插件Mobiscroll使用说明,需要的朋友可以参考下...2016-03-03- 直接为大家介绍制作过程,希望大家可以喜欢。HTML结构该页面切换特效的HTML结构使用一个<main>元素来作为页面的包裹元素,div.cd-cover-layer用于制作页面切换时的遮罩层,div.cd-loading-bar是进行ajax加载时的loading进...2015-10-30
jQuery 1.9使用$.support替代$.browser的使用方法
jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support 。 在更新的 2.0 版本中,将不再支持 IE 6/7/8。 以后,如果用户需要支持 IE 6/7/8,只能使用 jQuery 1.9。 如果要全面支持 IE,并混合...2014-05-31- 本文实例讲述了jQuery实现鼠标滑过链接控制图片的滑动展开与隐藏效果。分享给大家供大家参考,具体如下:这里演示jQuery实现鼠标移动到链接上,滑动展开/隐藏图片效果,鼠标放在“上一页”“下一页”上,立即浮现出所对应的图...2015-10-30
jQuery+PHP发布的内容进行无刷新分页(Fckeditor)
这篇文章将使用jQuery,并结合PHP,将Fckeditor发布的内容进行分页,并且实现无刷新切换页面。 本文假设你是WEB开发人员,掌握了jQuery和PHP相关知识,并且熟知Fckeditor的配置和使用。...2015-10-23- jQuery实现带玻璃流光质感的手风琴特效是一款基于jQuery+CSS3实现的带玻璃流光质感的手风琴特效,分享给大家,具体如下效果图:具体代码如下:html代码: <section class="strips"> <article class="strips__strip"> <di...2015-11-24
- 有时候我们为了省事就操作键盘组合键去代替使用鼠标,我们今天就使用JQuery实现Ctrl+Enter提交表单。我们发帖时,在内容输入框中输入完内容后,可以点击“提交”按钮来发表内容。可是,如果你够“懒”,你可以不用动鼠标,只需按...2015-10-23
- 一个简单的jQuery分页插件,兼容AMD规范和requireJS./** * jQuery分页插件 * */;(function (factory) { if (typeof define === "function" && define.amd) { // AMD模式 define([ "jquery" ], factory); } els...2015-11-08
jQuery+slidereveal实现的面板滑动侧边展出效果
我们借助一款jQuery插件:slidereveal.js,可以使用它控制面板左右侧滑出与隐藏等效果,项目地址:https://github.com/nnattawat/slideReveal。如何使用首先在页面中加载jquery库文件和slidereveal.js插件。复制代码 代码如...2015-03-15