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...