wScratchPad
wScratchPad copied to clipboard
Option for mouseover scratch instead of click event?
Would be great to have an easy option (true/false) for having a click event for the scratch, versus hover to erase.
Change 125 line
$(this.canvas)
.hover(function(e){
if(!$this.enabled) return true;
e.preventDefault();
e.stopPropagation();
//reset canvas offset in case it has moved
$this.canvas_offset = $($this.canvas).offset();
$this.scratch = true;
$this.scratchFunc(e, $this, 'Down');
})
not sure what you mean, you have need to trigger the scratch with a click event in the first place.
I too want to "scratch off" as the mouse moves over the canvas (without having to first click anywhere, as long as the webpage is loaded and active)
Sorry for my short comment before with no code to help - I still dont have time to provide a full pull request with a configuration param - but I can provide you a link to my working version that replaces the mousedown and mouseup with mouseenter and mouseout to provide the scratch with no clicking.
A full working live example of this is now on the home page of https://myJoomla.com
And my modified file live is https://myjoomla.com/wp-content/themes/myjoomla/js/wScratchPad/src/wScratchPad.js
Again sorry this is a comment and not a pull request, I would normally but in full daddy mode during summer holidays, and lack of time to code at nights.