This little bit of coffeescript can be used to replace inline hints from formtastic with a tooltip that appears whenever the user hovers over an image.
$('.formtastic p.inline-hints').each (index) ->
$(this).hide()
label = $(this).siblings('label')
label.append(
"<a href='#' title='" +
$(this).html() +
"' class='hint_modal'>
<img src='/assets/qm_small.png'
style='vertical-align: middle;'/>
</a>"
)
label.find('a.hint_modal').tooltip()
If you enjoyed this post, make sure you subscribe to my RSS feed!




0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment