Last active
August 29, 2015 13:56
-
-
Save wuliupo/9087735 to your computer and use it in GitHub Desktop.
fix the position of asp:CalendarExtender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:TextBox ID="idInputButton" runat="server" /> | |
<asp:ImageButton ID="idImageButton" ImageUrl="~/Images/calender.png" AlternateText="Click to show calendar" runat="server" /> | |
<asp:MaskedEditExtender ID="fromCalendarMEE" runat="server" | |
TargetControlID="idInputButton" Mask="9999/99/99" MaskType="Date" Century="2000" AutoComplete="true" CultureName="sv-SE"/> | |
<asp:CalendarExtender OnClientShown="fixCalendarPosition" ID="fromCalendarButtonExtender" runat="server" TargetControlID="idInputButton" PopupButtonID="idImageButton" Format="yyyy'-'MM'-'dd" /> | |
<script type="text/javascript"> | |
function fixCalendarPosition(cal) { | |
var off = $(cal._element).offset(); | |
$(cal._container).css({position: 'fixed', left: off.left, top: off.top + 22}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment