Skip Navigation

[Gelöst] Pure CSS tooltip

This support ticket is created vor 5 Jahre, 5 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 8 Antworten, has 2 Stimmen.

Last updated by Akhil vor 5 Jahre, 5 Monate.

Assisted by: Nigel.

Author
Artikel
#1150558

Hi nigel.,

i am trying to implement a simple pure css tooltips to display the operating hours.

this is my simple code.

<a tooltip="[types field='rd-mon-start-hours'][/types] to [types field='rd-mon-end-hours'][/types]"> op hours </a>

, but it doesn't output anything, am i doing anything wrong here?

when i try simple code without toolset field it works fine.

Thanks

#1150668

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

What solution are you using for tooltips?

There is no built-in solution with WordPress, but if you are using Bootstrap you can add them as described here: hidden link

But if you are adding a tooltip attribute directly to a link it sounds like you are using something else.

#1151080

i am using pure css tooltips but yes let me try the bootstrap method. thanks

#1151209

Hi , pls test this code, it doesnt accept html as title?

.

the issue is the <br> ?

#1151225

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

The documentation says that you need to specify the html option as true if you want to be able to use html within the title that is used for the tooltip content: hidden link

#1151390

Hi Nigel, this look way too complicated than i imagine.

if i need to enter some conditional code to output the tooltip title , do i need to create a separate view for this ?

currently i am using this pure css approach but its not accepting the conditional codes.
https://stackoverflow.com/questions/40531029/how-to-create-a-pure-css-tooltip-with-html-content-for-inline-elements

#1151414

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

tooltip.gif

Hi Dee

I looked at the solution in that stackoverflow article and effectively copied and pasted it into my WordPress site and it worked, so then I modified it a little to use a types shortcode to output a thumbnail of an image field for the tooltip content, and that worked okay.

I ended up with this:

<p>An <dfn title="onomasticon"><button disabled class="dfn-tooltip"><p>[types field='logo' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional'][/types]</p></button></dfn> is not a dinosaur.</p>

and I used the CSS from the SO answer:

dfn {
  position: relative;
  display: inline-block;
  cursor: help;
}
dfn:before {
  content: attr(title);
}
dfn > .dfn-tooltip {
  display: none;
}
dfn:hover > .dfn-tooltip {
  display: block;
  position: absolute; 
  top: calc(1em + 5px);
  max-width: 20em;
  background: #ccc;
  padding: .5em;
  border: none;
  cursor: help;
}
.dfn-tooltip img {
  max-width: 12em;
}

And you can see the results with it working in the screen recording.

#1151495

Hi Nigel.

Thank You.
yes it work for me to here: hidden link
hover the clock icon to see the tooltips.

As mention above,
what i am stuck at is for conditional codes to detect if the field is empty. etc.

#1151719

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.