Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:06:43+00:00 2026-05-30T21:06:43+00:00

I have a tooltip that activates(shows) when the target text is hovered over. For

  • 0

I have a tooltip that activates(shows) when the target text is hovered over. For touch devices, the person can click the target text and the tooltip will display, then when they touch the TOOLTIP(not target text) the tooltip hides. But I want the person with the mouse to be able to select the text in the tooltip, the problem is that when they click on the tooltip, it hides, which is the functionality for the touch devices.

So, for computers(with a mouse) I want the tooltip to be able to be clicked without it hiding, but on touch devices I want the tooltip to hide when it’s clicked to make it easier for the user. Hope that makes sense.

What’s the best way to go about this? Is there a way for me to say “when touched, do this, but when clicked(with a mouse), do that”?

http://jsfiddle.net/nicktheandroid/fdWW5/4/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:06:44+00:00Added an answer on May 30, 2026 at 9:06 pm

    This is probably overkill, but these are some jQuery extensions I use to facilitate touch events across browsers:

    jQuery.fn.touchstart = function (callback) {
    this.each(function () {
    var _self = jQuery(this);
    var onTouchstart = function (ev) {
      if (ev.originalEvent) {
        if (ev.originalEvent.targetTouches) {
          AddTouchPropertiesToJQEventObject(ev);
          callback.call(this, ev);
        }
      }
    };
    _self.bind('touchstart', onTouchstart);
    });
    return this;
    };
    
    jQuery.fn.touchmove = function (callback) {
    this.each(function () {
    var _self = jQuery(this);
    var onTouchMove = function (ev) {
      if (ev.originalEvent) {
        if (ev.originalEvent.targetTouches) {
          AddTouchPropertiesToJQEventObject(ev);
          callback.call(this, ev);
        }
      }
    };
    _self.bind('touchmove', onTouchMove);
    });
    return this;
    };
    
    jQuery.fn.touchend = function (callback) {
    this.each(function () {
    var _self = jQuery(this);
    var onTouchEnd = function (ev) {
      var lastTouchMoveInfo = _self.data('lastTouchMoveInfo');
      ev = $.extend(ev, lastTouchMoveInfo);
      callback.call(this, ev);
    };
    var onTouchMove = function (ev) {
      var lastTouchMoveInfo = {
        pageX: ev.pageX,
        pageY: ev.pageY,
        touches: ev.touches
      };
      _self.data('lastTouchMoveInfo', lastTouchMoveInfo);
    };
    _self.touchstart(onTouchMove);
    _self.touchmove(onTouchMove);
    _self.bind('touchend', onTouchEnd);
    });
    return this;
    };
    
    var AddTouchPropertiesToJQEventObject = function (jqEventObject) {
      jqEventObject.pageX = jqEventObject.originalEvent.targetTouches[0].pageX;
      jqEventObject.pageY = jqEventObject.originalEvent.targetTouches[0].pageY;
      jqEventObject.rotation = jqEventObject.originalEvent.rotation;
      jqEventObject.scale = jqEventObject.originalEvent.scale;
      jqEventObject.targetTouches = jqEventObject.originalEvent.targetTouches;
      jqEventObject.touches = jqEventObject.originalEvent.touches;
    };
    

    Basically you want to bind to touchstart, touchmove, and touchend. Or maybe just touchstart for what you are doing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have a tooltip that only comes up when you click
I have a popup system that shows a image when you hover over a
I have a jQuery tooltip plugin that displays a tooltip when I hover over
I want to have a tooltip that shows different things when the mouse goes
I have created a tooltip that appends a DIV with text to the page.
I have written a function that positions a tooltip just above a textbox. The
Right now, I have a tool tip that pops up when I hover over
I have a tooltip that has a link to an anchor but it seems
I have a Dojo tooltip that's been initialized and it works perfectly find when
Is there bundle for textmate or sublime text 2 that will show me what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.