Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional between delay mouseenter and show #79

Open
slindstr opened this issue Nov 12, 2015 · 4 comments
Open

Optional between delay mouseenter and show #79

slindstr opened this issue Nov 12, 2015 · 4 comments

Comments

@slindstr
Copy link
Contributor

First off, thanks again for EasyZoom - it's been really helpful!

I need to add a delay between mouseenter and show so I wrote some code that adds an optional delay and updated the documentation (PR incoming after I finish writing this...).

I could probably also do this in my own code when I bind an element, but figured it might be a common enough use case that others might benefit from it as well. Lemme know what you think; if the code needs any changes or it's just not right for the project no biggie.

Thanks again!

slindstr pushed a commit to slindstr/EasyZoom that referenced this issue Nov 12, 2015
@fernandoval
Copy link

I am needing this feature, too.

To disable EasyZoom when resolution is smaller than 768px I am putting a DIV over it with class "visible-xs" and "position: absolute; top: 0; left: 0; width: 100%; height: 100%;".

@i-like-robots
Copy link
Owner

Having considered this for some time (my apologies for taking so long, @slindstr - I've been very busy) I think this requires a combination of features. The 'mouse stop' event is useful when the users intention is to simply move their cursor over but not to interact with the zoom.

@fernandoval I think the issue you allude to requires something different. To zoom pictures on small - and we'll assume touch-enabled - devices it may be better to activate the zoom image with a standard zoom gesture as the user intention then is not ambiguous.

@fernandoval
Copy link

Yes. Will be awesome when EasyZoom can detect touch screen device and activate with zoom gesture. But this is not easy to implement. Then I did the easy way.

@nolexity
Copy link

nolexity commented Jan 7, 2020

I fix it for myself in EasyZoom.prototype._onEnter

	var that = this;
	if (!touches || touches.length == 1) {
		var showDelay;
		if (!touches) {
			showDelay = that.opts.mouseDelay;
		} else {
			showDelay = that.opts.touchDelay;
		}

		setTimeout(function() {
			if (that.isMouseOver) {
				e.preventDefault();
				that.show(e, that);
			}
		}, showDelay);
	}

and declaring mouseDelay:500 and touchDelay:500 variables in defaults

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

No branches or pull requests

4 participants