Re-center Modal Popup with Javascript

I have a modal popup that initially shows some content but extends the div if the checkbox is checked. The modal expands correctly, but does not return unless you scroll up or down. Is there a javascript event that I can apply to my javascript function to relay everything modal?

+4
source share
3 answers

Here is what it is:

$find('ModalPopupExtenderClientID')._layout(); 

For instance:

 $find('detailsPopUpExtenderId')._layout(); 

and in aspx:

 <ccl:ModalPopupExtender runat="server" ID="MyPopUpExtender" TargetControlID="pop" PopupControlID="PopUp" BehaviorID="detailsPopUpExtenderId" BackgroundCssClass="ModalBackground" /> 

BehaviorID is a property in which to set the clientide identifier.

+10
source

Be careful that this is not related to the window resize event. If so, your re-inclusion may trigger a resize event in IE, which will trigger an infinte loop.

If it is tied to a resize event, allow 1 or 2 resize events, but then ignore the rest. (I say 2, because in IE the β€œrestore” event in the window will trigger at least 2 resize events (3 in IE6).

+1
source

No matter what event you bind to scrolling, to put it in the center, bind this event to the / div check event, as well (or call it from another event). It is hard to say more without seeing the code.

0
source

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


All Articles