Mobile phone device has a screen unlock the application believe that everyone is not unfamiliar, on mobile devices, users can set the lock pattern as a password for the device user interface to lock, the lock interface as shown in the following figure.
The effect diagram looks like this
JavaScript Code
<script>
$ ("#gesturepwd"). GESTUREPASSWD ({
backgroundcolor: "#2980B9",//Background color
: "#FFFFFF",/// main control color
roundradii:50, The radius of the circle
pointradii:12,////////////////////////////////////////////////
space:60
: 480,//The height of the entire component
LineColor: "#ECF0F1",// user underline the color of the line
zindex:100//CSS Z-index properties of the entire component
});
$ ("#gesturepwd"). On ("haspasswd", function (e,passwd) {
var result;
if (passwd = = "1235789") {
result=true;
}
else {
result=false;
}
if (result = = True) {
$ ("#gesturepwd"). Trigger ("Passwdright");
settimeout (function () {
//password verification is correct after other operations, open new pages, etc. ...
alert ("pattern is correct")
},500); Delay for half a second to take care of visual effects
}
else{
$ ("#gesturepwd"). Trigger ("Passwdwrong");
Other actions after password validation errors ...
}
});
The above code is also very simple, the pure JS code to achieve mobile device mapping unlock, of course, this is the core code, others need to be small partners in accordance with their own needs to play. I hope this article can help you to share.