0
如何在日历自己的文本中添加悬停事件,简单消息当天发生了什么?Asp.net日历 - 日间悬浮文本
如何在日历自己的文本中添加悬停事件,简单消息当天发生了什么?Asp.net日历 - 日间悬浮文本
这里有造型的ASP.NET Calendar
(含onmouseover-style
)一些小技巧,发现here:
Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
Dim onmouseoverStyle As String = "this.style.backgroundColor='#D4EDFF'"
Dim onmouseoutStyle As String = "this.style.backgroundColor='@BackColor'"
Dim rowBackColor As String = String.Empty
e.Cell.Attributes.Add("onmouseover", onmouseoverStyle)
e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor))
If Not e.Day.IsWeekend Then
e.Cell.Attributes.Add("onmouseover", onmouseoverStyle)
e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor))
End If
例如,你可以使用jQuery显示工具提示onmouseover
。