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

Using PowerTip with SVG on touch screens #111

Open
BradyStephenson opened this issue Apr 14, 2014 · 2 comments
Open

Using PowerTip with SVG on touch screens #111

BradyStephenson opened this issue Apr 14, 2014 · 2 comments
Labels
Feature Software improvements that involve implementing new features.

Comments

@BradyStephenson
Copy link

First... THANK YOU for such a fantastic plugin that does so much without being overwhelming AND that isn't abandonware. ;)

I'm putting together a site called MessiahsPassoverWeek.info and PowerTip is perfect for what I needed to accomplish. It works great on computers but I'm having an issue in that I can't seem to get the PowerTips to work with SVG elements on tablets/touch screens. Is there a trick to getting the PowerTips to show up on the touch of an SVG element?

Thanks again!

@stevenbenner
Copy link
Owner

I haven't done much testing with PowerTip in touch environments. There are some hurdles with touch that PowerTip doesn't specifically work around. Generally a tap will cause the mouseover event to fire, but in touch environments it might be better to hook to click and/or directly to touch events. However, PowerTip doesn't listen for those by default.

I'll do some investigation.

@philgyford
Copy link

In case it's useful to anyone, I wanted to have powerTip open a little more smoothly on touch-based devices (although I'm not using SVG elements). So far I have:

if ('ontouchstart' in document.documentElement) {
    // This is a touch-based device.
    $('body').on('touchstart', '.js-tt', function() {
        $(this).powerTip('show');
    });
};

Where the .js-tt class is on all of my elements that should have tooltips.

This seems to work - powerTip opens less sluggishly than when relying on the device's touch-based substitute for hovering. But there is a bit of a flicker, which suggests the original event is still firing and (maybe) opening powerTip again? I'm not sure what that original event is, or how to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Software improvements that involve implementing new features.
Projects
None yet
Development

No branches or pull requests

3 participants