[RESOLVED] Modal Popup Drag/Drop
SO I created a Panel to use to drag my modal popup, but any movement of it when you release the mouse it returns back to it's original position. ANy idea what causes this behavior and how to stop it? Using Master Pages, but staying inside the content area.
Code:
<asp:Panel ID="pnlOwner" CssClass="pnlBackGround" runat="server" Width="450px">
<asp:Panel ID="pnlOwnerDrag" runat="server"><b>Select Endorsements:</b> </asp:Panel>
<div id="divOwner" style="height: 250px; overflow: auto;">
<asp:CheckBoxList ID="cblOwnerEndorsementsPop" runat="server"></asp:CheckBoxList>
</div>
<br />
<asp:Button ID="btnOwnerOk" runat="server" Text="OK" UseSubmitBehavior="False" CausesValidation="false" />
<asp:Button ID="btnOwnerHackOk" runat="server" Text="OK" Style="display: none" />
<asp:Button ID="btnOwnerCancel" runat="server" Text="Cancel" UseSubmitBehavior="False" />
</asp:Panel>
<asp:ModalPopupExtender ID="mpeOwner" runat="server"
PopupControlID="pnlOwner"
TargetControlID="btnOwnerHack"
BackgroundCssClass="modalBackground"
DropShadow="True"
OkControlID="btnOwnerHackOk"
CancelControlID="btnOwnerCancel"
PopupDragHandleControlID="pnlOwnerDrag"
Enabled="True">
</asp:ModalPopupExtender>
Re: Modal Popup Drag/Drop
This javascript in the page_load resolved it:
Code:
function setBodyHeightToContentHeight() {
document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + "px";
}
setBodyHeightToContentHeight();
$addHandler(window, "resize", setBodyHeightToContentHeight);