Simple JavaScript code realizes the technique of unlocking _javascript of mobile device drawing

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.