Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Option for mouseover scratch instead of click event? #19

Open
stebesplace opened this issue Aug 19, 2013 · 4 comments
Open

Option for mouseover scratch instead of click event? #19

stebesplace opened this issue Aug 19, 2013 · 4 comments

Comments

@stebesplace
Copy link

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

@iam-medvedev
Copy link

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

@websanova
Copy link
Owner

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

@PhilETaylor
Copy link

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
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants