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
。