Custom Tooltips?

  1. 5 years ago
    Edited 5 years ago by Niuwang

    Is there anyway to make a custom 'tooltip' plugin for certain text. I'm planning on utilizing a plugin from another site for a TCG that enables one to view the card information upon hover. It loads the card and displays it within a tooltip.

    Like so:

    -image-

    Unrelated but still wondering:
    If I wanted to create a channel dropdown list rather than displaying all the channels...above the forum in the postBody. Hows should I go about doing so? I know that I would echo out the form variable, but eh..I'll figure it out although guidance would be nice.

  2. For the tooltip plugin it's definitely doable. My take on it:

    You're going to need to use javascript to implement the tooltip, so you could have your plugin wrap a word in a span tag such as <span class="tooltip_123">words</span>. Look into existing plugins files, for example the one that does auto hyperlinking of URLs. Then your javascript can act on mouseover of that span class. I'm not sure of specific example code for this but it shouldn't be difficult. Then throw on some CSS for that class to get the underline/colors you want.

  3. Edited 5 years ago by Niuwang

    I'm looking to just edit the Link BBCode but add a hover property where the tooltip would be displayed and use external links for the JS. I know someone already made a plugin for wordpress using TinyMCE.

    I'm trying to avoid overcrowding myself with plugins that need to be enabled and disabled rather, just edit existing ones to save time and space.

    HEX TCG Tooltips

    Although if I can make a custom bbcode that adds a tooltip to selectable text like [card=url]text[/card] then that'd be a lot easier if I was any decent with regular expression, but I'm not.

 

or Sign Up to reply!