Disable Tooltips on Links when using Touch Devices


#1

I searched this forum for “tooltips” and was surprised to find no previous queries on this topic. Amazing! Well, here’s the situation…

I have links with tooltips in my LG content. (For MD and smaller, I have reworked my content and eliminated the tooltips.) I want the tooltips displayed (obviously) but only on desktop computers. I do NOT want the tooltips displayed on any mobile/touch device. But the problem is that the 12.9" iPad displays Blocs “LG” content, and hence it displays the tooltips, forcing the user to tap 2 times for every single link on which there is a tooltip. This is frustrating beyond words.

I found the following discussion on this matter:

The only code shown in that discussion that makes any sense is the following, since it sniffs out whether the device is Touch or not (rather than blindly just make a choice based on display size).

function isTouchDevice(){
    return true == ("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch);
}
if(isTouchDevice()===false) {
    $("[rel='tooltip']").tooltip();
}

I added that code to the Footer of my Blocs document and then tested in Apple’s Simulator app (in MacOS High Sierra), and within Simulator I selected a 12.9" iPad (since I don’t have a physical iPad that large to test on), and I loaded my Blocs website and clicked on my links in the Simulator only to find no change! Your first click shows the tooltip, and then you must stupidly click a second time to engage the link. So either that code is wrong or that code doesn’t work inside the Simulator app because it somehow knows I am running a Simulator on a desktop computer instead of an actual touch device. I don’t know. But surely someone out there has a 12.9" iPad who can test this sort of thing.

You would think this tooltip issue would be already settled and built into Bootstrap 4, but clearly it is not. Odd.

Surely I am not the only Blocs user who has encountered this, so I look forward to hearing the solutions that some of you have been using to suppress tooltips on touch-based mobile devices (regardless of display size).

Thank you,

James


#2

Hello @JDW
Add the following code to your page preferences:

@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
    .tooltip {
        display: none !important;
    }
 }

#3

Always the professional with wonderful code solutions! I just confirmed it works great.

Thank you, @Pealco

:partying_face:


#4

OK, now lets go to the other code…


#5

Hi @Pealco
can you please tell me where I put the code?
Is this the Add Code section in the Page settings ?
tom


#6

Hi @tom2

Should be added to page settings under header. You might need to set it between style tags.

MDS


#7

Hello @MDS and @tom2 yes, @MDS you’r right should be in page preferences and the code is the following completed

<style>
 @media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
    .tooltip {
        display: none !important;
    }
 }
</style>

Sorry it was the forum that delete the style tag…


#8

Hi @Pealco and @MDS
thanks for your help !
tom :blush:


#9

Keep in mind that code only works on tablets like the iPad. It doesn’t work on the iPhone though. (You can verify this yourself either on actual devices or just download XCODE and use the Simulator app to simulate various iOS, iPhone and iPad versions – even the Apple TV!) In my application that’s OK because I only have tooltips on my navigation dropdown menu, and the menu for LG differs from my menu for MD and smaller screens. (I did not put tooltips on my menu that displays in MD and smaller.)

I suspect though that most Blocs users will want to bloc tooltips from all mobile touch devices like iPads and iPhones. There doesn’t seem to be an easy solution for that which doesn’t also block tooltips on touch notebooks too.

So again, if your needs are like mine and you only want to block tooltips on tablets like the iPad, then the code @Pealco very kindly created works great.


#10

FYI: Its located in the very same thread you yourself linked to in your original post. :stuck_out_tongue_winking_eye:


#11

Regardless of who wrote it or linked to it, the point of my previous post remains. If you need to kill tooltips on all touch devices including iPhones, it won’t work. That code is for iPads.


#12

@JDW, I was only responding that singular facet of your post.

Yes, I’ve noticed it quite a bit across threads / responses.

Sure thats the primes of specific media queries to target specific device ranges .

Just passing through don’t mind me. :–)


#13

@Blocs_User

I don’t know what you trying to do… but I will explain you how life works this days.

Anyone in here can copy/paste code or text or whatever. But they have to take time to do the search. And some times they found in a lot of threads codes, but they can’t implement in Blocs, so you/me can help.

I didn’t know that your car have square tires, I suppose that because other people already used circular tires, so you can’t use them right?

And no I don’t use a lot the copy paste solutions, but you know what? I will no more make any replies in this forum… YOU help the people and take all the time that I’m using here to help in here.

I think I know why you upset, probably some codes I reveal here, allow people to fix their problems, without the use of brics… who knows???

@MDS, @webplus, @JDW, @Wam, @wolfganghofer you have here a user that will replace me while I’m leaving the forum…


#14

@KBConcepts, @tom2, @Eldar, @cableguy30, see you soon…

And be careful, bootstrap4 was created but can’t be used because you can’t copy/pasting some solutions… @Norm be careful.

All the other users was a pleasure…


#16

Hi! Not sure I am following what’s happening here!
@Pealco are you going on a well-deserved vacation? :slight_smile:


#17

Hi @Eldar

It would appear that Blocs_User’s talent to offend has stroke again…


#18

Hello @Pealco

My opinion is that you are doing a great job for the entire Blocs community. Thanks.

And if a user does not value their work, that user’s problem. I think that people like you do great good to others.

Their solutions to the problems posed by others are always very good.

My opinion is that “time” is the most precious asset of a person and when it is dedicated to helping others, we must always thank it.

I hope you do not decide to leave the forum, as it would be a great loss for all.

In what my opinion may represent, I would be very happy if you do not leave this forum, just decide who to help and who does not.

MANY THANKS @Pealco.

It is always a pleasure to talk with you.

With best regards.


#19

Oh no.
Please don’t leave. We need you here, man.
You helped so many guys here in this forum.
Please stay.


#20

Hi @Pealco

Your expertise and willingness to help is greatly appreciated.

We need you as part of the team!

MDS


#21

I’m not upset.

Obviously people like that you search for them and show how to implement those topical searches into Blocs. I have found it interesting reading threads that you choose not to correct people whom were heaping praises upon you across multiple threads and instead preferring to take the credit of others from your searches. Beyond the premise of attributing, many times the found solutions may or may not be optimal, so a lot of times supplying the source link provides more in-depth context, learning and understanding for others on the topic being discussed.

It seems rather silly you’ve gotten upset with saying you will now run off. By all means don’t let me hinder your process, carry on. Sorry if you felt offended.