简要教程
jQuery-peeper是一款jQuery显示隐藏和复制表单密码字段插件。该插件提供多种方式显示和隐藏表单password字段的密码,并额外提供复制密码字段为纯文本的功能。
使用方法
安装
npminstalljquery-peeper
在页面中引入下面的文件。
<linkrel="stylesheet"href="/jquery-peeper/dist/css/jquery-peeper.min.css"/>
<scriptsrc="/path/to/jquery.js"></script>
<scriptsrc="/path/to/jquery-peeper.min.js"></script>
jQuery显示隐藏和复制表单密码字段插件
初始化插件
$(function(){
$("#password1").peeper();
});
配置参数
$(function(){
$("#password1").peeper({
showEvent:'mouseup',//eventtoshowpassword
showElement:'.peeper-mask',//DOMelement(eg.buttontoshowpassword)
mask:true,//showmask
maskOpacity:1,//maskopacity(eg.0.5)
autohide:true,//hidepasswordaftertime
autohideTime:4000,//hidepasswordtimeinms
maskCss:'gray',//maskstyle(eg.red,green,blueorcustom)
showPasswordCss:'fafa-key',//showpasswordicon/style
copyPasswordCss:'fafa-copy',//copypasswordicon/style
showCopyBtn:true,//copypasswordbutton
showPasswordBtn:true,//showpasswordbutton
animateDuration:300//maskanimationtime
});
});
如果您觉得本文的内容对您的学习有所帮助:
关键字:
jQuery