将工具提示添加到 asp.net mvc 中的帮助程序 html.dropdownlist
我有一个仅显示产品代码 101,102,103 的下拉列表,
如果用户将鼠标悬停在产品代码上,我希望标题显示为工具提示。
所以这不是你正常的 DataValue & DataText 场景,因为“101”既是显示文本又是显示文本。值。
我相信我需要使用 jQuery 来实现这种效果。 我还相信我需要将每个列表项的标题属性设置为产品标题。
我的问题是,使用helper html.dropdownlist如何设置标题属性?
谢谢,这是我第一天使用MVC
I have a dropdownlist that displays just products codes 101,102,103
If the user hovers over a product code I would like the title to appear as a tooltip.
So it's not your normal DataValue & DataText scenerio, because "101" would be both the display text & the value.
I believe I will need to use jQuery to achive this effect.
And I also believe I would need to set the Title attribute of each list item as the Product Title.
My question is, using helper html.dropdownlist how can I set the title attribute?
Thanks, this is my first day using MVC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们曾经用“tipsy”来表达非常相似的东西。 http://plugins.jquery.com/project/tipsy
我们实际上更进一步, “创建”这样的属性
原因是醉酒有时仍会显示常规工具提示。我们使用了一些像这样的高级设置。
另外你还可以设置主题。甚至还能够让它支持嵌入在工具提示中的 html 链接等。
Twitter过去用的是Tipsy。我不确定他们是否仍然这样做。
We used tipsy once for something very similar. http://plugins.jquery.com/project/tipsy
We actually took it a step further and "created" an attribute like this
The reason was that tipsy would still show the regular tooltip on occasion. We used some of the advanced settings like this.
Plus you can theme it. Also were even able to get it to support html embedded in the tooltips for links and such.
Twitter used to use tipsy. I'm not sure if they still do.