jquery实现页面虚拟键盘特效_jquery

WBOY
Release: 2016-05-16 15:46:10
Original
1710 people have browsed it

用法简介:

jquery页面虚拟键盘设计带有数字与字母切换功能。

文件引用:

//给输入的密码框添加新值 function addValue(newValue) { CapsLockValue==0?$(".input_cur").val($(".shuru").val()+ newValue):$(".input_cur").val($(".shuru").val()+ newValue.toUpperCase()) } //清空 function clearValue() { $(".input_cur").val(""); } //实现BackSpace键的功能 function backspace() { var longnum=$(".input_cur").val().length; var num ; num=$(".input_cur").val().substr(0,longnum-1); $(".input_cur").val(num); } function changePanl(oj){ $("#"+oj).siblings("div").hide(); $("#"+oj).show(); } //设置是否大写的值 function setCapsLock(o) { if (CapsLockValue==0){ CapsLockValue=1; $(o).val("转化小写"); $.each($(".i_button_zm"),function(b, c) { $(c).val($(c).val().toUpperCase()); }); }else{ CapsLockValue=0; $(o).val("转化大写"); $.each($(".i_button_zm"),function(b, c) { $(c).val($(c).val().toLowerCase()); }); } } window.onload=function(){ // changePanl("zimu"); }
Copy after login

CSS

.softkeyboard{ display:inline-block;} .softkeyboard td{ padding:4px;} .c_panel{ background-color:#333; text-align:center; padding:15px;} .input_cur{ border:1px solid #f00;} .i_button{ border:none; height:40px; width:50px; font-size:16px; font-family:"微软雅黑"; background-color:#666; color:#fff;} .i_button:active{ background-color:#999;} .i_button_num{} .i_button_btn{ float:right; width:88px;} .i_button_bs{ float:right; width:148px;}
Copy after login

HTML


Copy after login

演示效果:

屏幕键盘在网络生活中很常见,比如使用网银或在线查询信用卡余额,在输入密码等敏感数据时,应该就会用到屏幕键盘。以防止被木马或恶意程序捕获盗取实际键盘上的操作。希望本文能够对大家有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!