Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap tooltip without a link

To save space in a narrow table cell I want to use the bootstrap tooltip to display extra content on hover. However, the tooltip uses the :rel option in the a tag. I do not need a link, just its options...and I don't want the link to go anywhere. I have used:

  link_to display.text, "#", :rel => "tooltip", ...blah..blah
  link_to_function display.text, "#", :rel => ...blah...blah

Both work to an extent, however both return to the top of the page.

Its probably smelly code to use a link that isn't really a link to get at some other function. Is there a rails way of creating a dummy link? Is there an "approved" method of accomplishing this?

like image 420
hellion Avatar asked Feb 19 '23 17:02

hellion


1 Answers

You can initialize tooltips on other elements besides anchors. Try a span or a div.

like image 116
Sara Avatar answered Feb 27 '23 09:02

Sara