Bootstrap Show Password plugin


This jquery plugin could show and hide password with bootstrap2 or bootstrp3 version.

github here

step1:
link font-awesome.css(or you can just use Bootstrap's Glyphicon font )
link jquery library, bootstrap-show-password.js


step2:
html
html
Initialize plugin with data-*
NameAttributetypedefaultdescription
-data-toggleStringpasswordActive password without writing JavaScript.
placementdata-placementStringafterThe placement of show/hide icon, can be 'before' or 'after'.
messagedata-messageStringClick here to show/hide passwordThe tooltip of show/hide icon.
whitedata-whiteBooleanfalseShow the white icon. (Just work in bootstrap v2)
eyeClassdata-eye-classStringglyphiconBase eye icon class.
eyeOpenClassdata-eye-open-classStringglyphicon-eye-openOpen eye icon class.
eyeCloseClassdata-eye-close-classStringglyphicon-eye-closeClose eye icon class.
eyeClassPositionInsidedata-eye-class-position-insideBooleanfalsePuts the open/close class inside the <i>. Use this option with google material icons.
step3:
css
css
step4:
js
js
switch the icon to font-awesome with "fa".

the #password2 with event show.bs.password. When the password shows,the event fires.

Event TypeDescription
show.bs.passwordThis event fires immediately when the show instance method is called. If caused by a click, the clicked element is available as the relatedTarget property of the event.
hide.bs.passwordThis event is fired immediately when the hide instance method has been called.
$('#password').on('show.bs.password', function (e) {
    // code here
});





Popular posts from this blog

Fancyapps — easily build overlay windows with carousel

Meet Tippy.js: The Complete Tooltip Popover Plugin

Meet Mantine: A TS-Based Open-Source React Components Library