WeChat marketing platform system-scratch fun Development _ PHP Tutorial

Source: Internet
Author: User
Marketing Platform System-Development of scratch. Download jqueryextended wscratchpad.js, the page of the original site cannot be opened, I will write a wscratchpad-2.1.0.zip here and then (cool), some non-cool bloggers, direct to others

Download jquery extension wScratchPad. js, the original site page cannot be opened, I am here to provide a wScratchPad-2.1.0.zip

Then (cool), some non-cool bloggers directly turn to others' articles, and the verification process is saved. it should not be a small one. Let me fix it here.

In this expansion, how can we past the user's scratch area?

The code is as follows:


$ ("# WScratchPad3"). wScratchPad ({
Cursor: '', // Set the mouse style
Color: 'gray ', // sets the color of the cover, which is exclusive to the image2 function.
Width: "300 ",
Height: "100 ",
Image: "" // top image
// For more configuration-related options, see the source code.
ScratchUp: function (e, percent ){
If (percent> 60)
{
Alert ("sss ");
}
}
});

From the code above, we can see that this is not the same as the so-called tutorial on the internet. here, the obtained range used by the function is not

ScratchMove ()
Instead
ScratchUp ()

Why? View source code

The code is as follows:


ScratchFunc: function (e, $ this, event)
{
E. pageX = Math. floor (e. pageX-$ this. canvas_offset.left );
E. pageY = Math. floor (e. pageY-$ this. canvas_offset.top );
$ This ['scratch '+ event] (e, $ this );
If (this. settings. realtimePercent | event = "Up "){
If ($ this. settings ['scratch '+ event]) $ this. settings ['scratch '+ event]. apply ($ this, [e, $ this. scratchPercentage ($ this)]);
}
}

Here, we can get the UP bound to the function instead of moving it.

Jquery extends wScratchPad. js, the original site page cannot be opened, I provide a wScratchPad-2.1.0.zip here and then (cool), some non-cool bloggers, directly turn to others...

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.