Log in Sign up

Adding a tooltip to links on hover?

I love the hover preview used in the bigfoot footnotes within the magazine theme. Just wondering if there was a way to do similar when hovering over wikilinks (similar to that of wikipedia or obsidian)?


2 years ago, 2 replies   templates   developers   Edit question

This feature is not built into any of Blot's templates by default. However, if you're willing to write some JavaScript, you can add this functionality to your own template.

In general, my approach to solve this problem would be:

  1. Add an handler to each <a> tag in your post for the mouseover event
  2. On mouseover issue a HTTP request using XMLHttpRequest to the <a> tag's href attribute, appending the query string &json=true to receive the post's structured data.
  3. Parse the JSON for the linked post and then use its title and teaser properties to render your popover tooltip preview above the original <a>

Please let me know if you have any questions about this or anything else

Answered 2 years ago · Edit answer

Thank you!

Answered 2 years ago · Edit answer