Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 01, 2012 08:30 AM by omerdemir
Member
271 Points
528 Posts
Mar 26, 2012 08:42 AM|LINK
Hello guys.
I using this codes for displaying some additional details. I've not a lot of knowledge about javascript.
How can i add and where i have to add code to delay my hover tooltip?
any help would be appreciated..
Ömer
<script type="text/javascript" id="hover.details"> Type.registerNamespace("Demo"); Demo.ToolTip = function (panelid) { this._panelid = panelid; this.x = 0; this.y = 0; } Demo.ToolTip.prototype = { get_PanelID: function () { return this._panelid; }, set_PanelID: function (panelid) { this._panelid = panelid; }, BeginShowToolTip: function (event, diaid) { WebService.GetToolTipText(diaid, this.EndShowToolTip, this.OnError, this.OnTimeOut); this.x = 770; this.y = event.clientY - 200; }, EndShowToolTip: function (result) { var pnl = $get(tooltip.get_PanelID()); if (pnl.innerHTML != null) { pnl.innerHTML = result; } else { pnl.textContent = result; } pnl.style.visibility = "visible"; pnl.style.display = "inline"; pnl.style.position = "absolute"; pnl.style.left = tooltip.x + "px"; pnl.style.top = tooltip.y + "px"; }, HideToolTip: function () { var pnl = $get(this.get_PanelID()); pnl.style.visibility = "hidden"; pnl.style.display = "none"; }, OnError: function (result) { alert(result.get_message()); }, OnTimeOut: function (result) { alert(result); } } Demo.ToolTip.registerClass("Demo.ToolTip"); </script>
Star
10411 Points
1196 Posts
Mar 28, 2012 02:08 AM|LINK
Hi, you can try jQuery HoverIntent plugin, please refer to the following site:
http://archive.plugins.jquery.com/project/hoverIntent
You can also refer to the following example:
http://forums.asp.net/p/1771255/4844028.aspx/1?Re+jquery+hoverintent+method+not+working
611 Points
260 Posts
Mar 28, 2012 08:47 AM|LINK
omerdemir How can i add and where i have to add code to delay my hover tooltip?
Hey,
You can use the setTimeout(function,milliseconds)
All-Star
30184 Points
4906 Posts
Mar 28, 2012 10:37 AM|LINK
Hi,
You can use tooltip plugin.
http://www.delicious.com/anupdg/tooltips
Mar 29, 2012 02:20 PM|LINK
Thanks everyone for replies.
i tried this codes but did not work..
andy idea? any help?
Thanks in advance
HideToolTip: function () { var pnl = $get(this.get_PanelID()); pnl.style.visibility = "hidden"; pnl.style.display = "none"; }, timeMsg: function () { var t = setTimeout("HideToolTip()", 500); } //my gridview on row data bount event is protected void gvHrEmploye_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int diaid = Convert.ToInt32(gvAll.DataKeys[e.Row.RowIndex].Value); e.Row.Attributes.Add("onmouseover", "tooltip.BeginShowToolTip(event," + diaid + ") "); e.Row.Attributes.Add("onmouseout", "tooltip.HideToolTip(timeMsg)"); } }
Contributor
2228 Points
424 Posts
Mar 30, 2012 01:31 AM|LINK
Hi, hope this helps:
http://www.eggheadcafe.com/community/asp-net/17/10142982/datacontrolrowtypeheader.aspx
Mar 30, 2012 06:55 AM|LINK
Thank you for reply but i need add delay to my codes.
i just want to hide tooltip after 500ms onmouseout.
Cheeers
Apr 01, 2012 08:30 AM|LINK
Hello again.
Added function Hide and added clear timeout row to beginshowtooltip function. and its ok.
Hide: function () { hovertimeout = setTimeout(function () { tooltip.HideToolTip() }, 2000); }, HideToolTip: function () { var pnl = $get(this.get_PanelID()) pnl.style.visibility = "hidden"; pnl.style.display = "none"; }, BeginShowToolTip: function (event, diaid) { WebService.GetToolTipText(diaid, this.EndShowToolTip, this.OnError, this.OnTimeOut); this.x = 770; this.y = event.clientY - 200; clearTimeout(hovertimeout); },
omerdemir
Member
271 Points
528 Posts
JavaScript ToolTip Delay!
Mar 26, 2012 08:42 AM|LINK
Hello guys.
I using this codes for displaying some additional details. I've not a lot of knowledge about javascript.
How can i add and where i have to add code to delay my hover tooltip?
any help would be appreciated..
Ömer
<script type="text/javascript" id="hover.details"> Type.registerNamespace("Demo"); Demo.ToolTip = function (panelid) { this._panelid = panelid; this.x = 0; this.y = 0; } Demo.ToolTip.prototype = { get_PanelID: function () { return this._panelid; }, set_PanelID: function (panelid) { this._panelid = panelid; }, BeginShowToolTip: function (event, diaid) { WebService.GetToolTipText(diaid, this.EndShowToolTip, this.OnError, this.OnTimeOut); this.x = 770; this.y = event.clientY - 200; }, EndShowToolTip: function (result) { var pnl = $get(tooltip.get_PanelID()); if (pnl.innerHTML != null) { pnl.innerHTML = result; } else { pnl.textContent = result; } pnl.style.visibility = "visible"; pnl.style.display = "inline"; pnl.style.position = "absolute"; pnl.style.left = tooltip.x + "px"; pnl.style.top = tooltip.y + "px"; }, HideToolTip: function () { var pnl = $get(this.get_PanelID()); pnl.style.visibility = "hidden"; pnl.style.display = "none"; }, OnError: function (result) { alert(result.get_message()); }, OnTimeOut: function (result) { alert(result); } } Demo.ToolTip.registerClass("Demo.ToolTip"); </script>Allen Li - M...
Star
10411 Points
1196 Posts
Re: JavaScript ToolTip Delay!
Mar 28, 2012 02:08 AM|LINK
Hi, you can try jQuery HoverIntent plugin, please refer to the following site:
http://archive.plugins.jquery.com/project/hoverIntent
You can also refer to the following example:
http://forums.asp.net/p/1771255/4844028.aspx/1?Re+jquery+hoverintent+method+not+working
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
mhbalti
Member
611 Points
260 Posts
Re: JavaScript ToolTip Delay!
Mar 28, 2012 08:47 AM|LINK
Hey,
You can use the setTimeout(function,milliseconds)
"A candle loses nothing by lighting another candle."
asteranup
All-Star
30184 Points
4906 Posts
Re: JavaScript ToolTip Delay!
Mar 28, 2012 10:37 AM|LINK
Hi,
You can use tooltip plugin.
http://www.delicious.com/anupdg/tooltips
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
omerdemir
Member
271 Points
528 Posts
Re: JavaScript ToolTip Delay!
Mar 29, 2012 02:20 PM|LINK
Thanks everyone for replies.
i tried this codes but did not work..
andy idea? any help?
Thanks in advance
HideToolTip: function () { var pnl = $get(this.get_PanelID()); pnl.style.visibility = "hidden"; pnl.style.display = "none"; }, timeMsg: function () { var t = setTimeout("HideToolTip()", 500); } //my gridview on row data bount event is protected void gvHrEmploye_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int diaid = Convert.ToInt32(gvAll.DataKeys[e.Row.RowIndex].Value); e.Row.Attributes.Add("onmouseover", "tooltip.BeginShowToolTip(event," + diaid + ") "); e.Row.Attributes.Add("onmouseout", "tooltip.HideToolTip(timeMsg)"); } }FightAsABull
Contributor
2228 Points
424 Posts
Re: JavaScript ToolTip Delay!
Mar 30, 2012 01:31 AM|LINK
Hi, hope this helps:
http://www.eggheadcafe.com/community/asp-net/17/10142982/datacontrolrowtypeheader.aspx
omerdemir
Member
271 Points
528 Posts
Re: JavaScript ToolTip Delay!
Mar 30, 2012 06:55 AM|LINK
Thank you for reply but i need add delay to my codes.
i just want to hide tooltip after 500ms onmouseout.
Cheeers
Ömer
omerdemir
Member
271 Points
528 Posts
Re: JavaScript ToolTip Delay!
Apr 01, 2012 08:30 AM|LINK
Hello again.
Added function Hide and added clear timeout row to beginshowtooltip function. and its ok.
Hide: function () { hovertimeout = setTimeout(function () { tooltip.HideToolTip() }, 2000); }, HideToolTip: function () { var pnl = $get(this.get_PanelID()) pnl.style.visibility = "hidden"; pnl.style.display = "none"; }, BeginShowToolTip: function (event, diaid) { WebService.GetToolTipText(diaid, this.EndShowToolTip, this.OnError, this.OnTimeOut); this.x = 770; this.y = event.clientY - 200; clearTimeout(hovertimeout); },