Response title
This is preview!




<div id="myDatepicker1" class="hasDatepicker" style="display: inline-block;">
<div class="ui-datepicker-inline ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
<table class="ui-datepicker-calendar">
<tbody>
<tr>
<td class="ui-body-c" onclick="DP_jQuery_1297589131703.datepicker._selectDay('#myDatepicker',1,2011, this);return false;">
<a class="ui-state-default ui-btn ui-btn-up-c" href="#" data-theme="c">1</a>
</td>
...$(".ui-datepicker-calendar a").live("click", function() {
$("#myDatepicker1").hide();
});$("#myDatepicker1.ui-datepicker-calendar a").live("click", function() {
alert("hide myDatepicker1");
$("#myDatepicker1").hide();
});
// Soul_Master custom bug fix for ticket #8052
if (jQuery.browser.msie && jQuery.browser.version >= 9) {
jQuery.support.noCloneEvent = true;
}
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) );
$(this).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true });
(function($, undefined ) {
//cache previous datepicker ui methodvar prevDp = $.fn.datepicker;//rewrite datepicker$.fn.datepicker = function( options ){var dp = this;//call cached datepicker pluginprevDp.call( this, options );//extend with some dom manipulation to update the markup for jQM//call immediatelyfunction updateDatepicker(){$( ".ui-datepicker-header", dp ).addClass("ui-body-c ui-corner-top").removeClass("ui-corner-all");$( ".ui-datepicker-prev, .ui-datepicker-next", dp ).attr("href", "#");$( ".ui-datepicker-prev", dp ).buttonMarkup({iconpos: "notext", icon: "arrow-l", shadow: true, corners: true});$( ".ui-datepicker-next", dp ).buttonMarkup({iconpos: "notext", icon: "arrow-r", shadow: true, corners: true});$( ".ui-datepicker-calendar th", dp ).addClass("ui-bar-c");$( ".ui-datepicker-calendar td", dp ).addClass("ui-body-c");$( ".ui-datepicker-calendar a", dp ).buttonMarkup({corners: false, shadow: false});$( ".ui-datepicker-calendar a.ui-state-active", dp ).addClass("ui-btn-active"); // selected date$( ".ui-datepicker-calendar a.ui-state-highlight", dp ).addClass("ui-btn-up-e"); // today"s date$( ".ui-datepicker-calendar .ui-btn", dp ).each(function(){var el = $(this);// remove extra button markup - necessary for date value to be interpreted correctlyel.html( el.find( ".ui-btn-text" ).text() );});};//update nowupdateDatepicker();// and on click$( dp ).click( updateDatepicker );//return jqm objreturn this;};//bind to pagecreate to automatically enhance date inputs$( ".ui-page" ).live( "pagecreate", function(){$( "input[type='date'], input[data-type='date']" ).each(function(){$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) );});});})( jQuery );
//bind to pagecreate to automatically enhance date inputs
$( ".ui-page" ).live( "pagecreate", function(){
$( "input[type='date'], input[data-type='date']" ).each(function(){
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) );
});
});$(document).ready(function() {
$(".note").draggable();
$('.closebutton').click(function() {
alert("test");
});
});
I created a full working demo here:
Can anyone tell me what's the problem? It seems that this library calls the click-event one more time...?!
© 2012 jQuery Foundation
Sponsored by
and others.
