user1977840
user1977840

Reputation:

Placing a link inside of a tooltip

I have a situation where I need to display a link inside a tooltip. I have found several posts where people state that the best way is a hidden div, but I cant find any examples of this being done. Could anyone point me in the right place for an example of this?

Here is what I have so far for HTML. I figure the rest of it will be done in Jquery, which is my weakness.

<td><%= f.check_box :raw_footage_check_finished, :checked => true %>
<div id="tooltip" style="display:none"><%= link_to 'Mark Incomplete', '#' %>
</div></td>

I am using Ruby on Rails for my server side language.

Upvotes: 1

Views: 9362

Answers (1)

Christian
Christian

Reputation: 19750

You don't need to use any jQuery unless you're doing something really fancy. You can use plain 'ol CSS like so:

.parent .tooltip {
    display: none;
}

.parent:hover .tooltip {
    display: block;
}

It's not quite clear from your example how you want it to work, but here's a jsFiddle demo: http://jsfiddle.net/DEtnP/

Also, try to avoid inline CSS wherever possible.

Upvotes: 5

Related Questions