Close AJAX Control Toolkit BallonPopupExtender on mouse output

Does anyone know how to close the Ballon Popup Extender on the client side? Everything is in order, but since I set up BPE to display on the mouse hover, it is really improvised that it has no method to "close" or "hide" on the mouse, I tried:

function hideElement() { document.getElementById(ID).style.display = 'none'; } function hideControl() { document.getElementById('<%=ID.ClientID%>').style.visibility = "hidden"; return false; } 

I connected the methods above to one of the onmouseout divs, I can hide any control on the page but not the BPE, and I tried to do the same with the panel that the BPE is aiming at, but nothing happens.

Is there something I missed, or is it just BPE?

+4
source share
2 answers

This is actually not too complicated. You can create such a method on your page:

 <script type="text/javascript"> function hidePopup() { var popupObject = document.getElementById("<%= Panel1.ClientID %>"); popupObject.BalloonPopupControlBehavior.hidePopup(); } </script> 

And then call this function from your control's onmouseout event, which is your TargetControlID for BalloonPopupExtender (in my example, Panel1 ). Here is the code I used to test this javascript:

 <asp:Panel ID="Panel1" runat="server" BackColor="#009900" Height="50px" Width="50px" onmouseout="hidePopup();"> </asp:Panel> <asp:BalloonPopupExtender ID="Panel1_BalloonPopupExtender" runat="server" CustomCssUrl="" DisplayOnClick="False" DisplayOnMouseOver="True" DynamicServicePath="" Enabled="True" ExtenderControlID="" TargetControlID="Panel1" BalloonPopupControlID="junk"> </asp:BalloonPopupExtender> <div id="junk"> Hey! Here some stuff! </div> 
+3
source

Exactly what I was looking for. But instead of all the extra javascript just put onmouseout="BalloonPopupControlBehavior.hidePopup();" into the control.

+2
source

Source: https://habr.com/ru/post/1391896/


All Articles