I need to implement jquery tooltip in Asp.net MVC3-Razor view. Can anybody giv开发者_高级运维e some tips & samples to carry out this operation
Thanks, Selva
If you just want simple text to be shown in your tooltip, i found this to be the best solution -
:)
If you want to apply for different controls, do something like this -
@Html.TextBoxFor(model=>model.FieldName, new {title="Your Tooltip text goes here"})
works for everything except EditorFor. Enjoy.
Personally, I prefer the tooltip plugins that:
- Reuse a single container (vs. wrapping target elements in a bunch of curfty markup)
- Allow for tip content to be declared on the target element itself (via "data-" attributes)
- Allow full styling via css classes (on / off states, etc controlled by adding css classes as opposed to injecting inline style rules)
There are literally tons of options out there... when I last checked, this one was my personal preference:
http://code.drewwilson.com/entry/tiptip-jquery-plugin
But there are many more... including one native to jQuery UI coming soon!
http://blog.jqueryui.com/2010/05/jquery-ui-19m1-tooltip/
精彩评论