wScratchPad icon indicating copy to clipboard operation
wScratchPad copied to clipboard

Option for mouseover scratch instead of click event?

Open stebesplace opened this issue 12 years ago • 4 comments

Would be great to have an easy option (true/false) for having a click event for the scratch, versus hover to erase.

stebesplace avatar Aug 19 '13 20:08 stebesplace

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');
})

iam-medvedev avatar Nov 13 '13 17:11 iam-medvedev

not sure what you mean, you have need to trigger the scratch with a click event in the first place.

websanova avatar Apr 05 '14 23:04 websanova

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)

PhilETaylor avatar Aug 14 '14 20:08 PhilETaylor

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.

PhilETaylor avatar Aug 15 '14 22:08 PhilETaylor