tool tip div and pop up div using java script
In one of my module i came across the situation that i have to code for toop tip div and pop up div
let me explain what is toop tip .
I have hyperlink in gridview (View Message), when user hover on it i have to show content of it.
When user clicks on hyper link i need to show the div.
see above screen shots
java script for the tool tip
java script for popup div
Binding java script with control in .cs page
protected void gvReceivedMessages_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
CheckBox chkAll = (CheckBox)e.Row.FindControl("chkSelectAll");
chkAll.Attributes.Add("onclick", "javascript:SelectAll('" + chkAll.ClientID + "','" + gvReceivedMessages.ClientID + "')");
strChekAll = chkAll.ClientID;
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
//string s=e.Row.Cells[
//step1: find preview control (hyperlink)
CheckBox chkSelect = (CheckBox)e.Row.FindControl("chkSelect");
chkSelect.Attributes.Add("onclick", "fnCheck('" + chkSelect.ClientID + "', '" + strChekAll + "')");
HyperLink hylnkMessage = (HyperLink)e.Row.FindControl("hylnkMessage");
hylnkMessage.Attributes.Add("onclick", "javascript:showDiv(event)");
//hylnkMessage.Attributes.Add("onMouseout","javascript:popclose()");
//onMouseover="ddrivetip('JavaScriptKit.com JavaScript tutorials','yellow', 300)";
//onMouseout="hideddrivetip()"
hylnkMessage.Attributes.Add("onMouseover","javascript:ddrivetip('this is testing')");
hylnkMessage.Attributes.Add("onMouseout", "javascript:hideddrivetip()");
//chkReply.Attributes.Add("onclick","javascript:Reply(this,)"
}
}
}