まず、私はJavaスクリプトとjquery.iに慣れていません。つまり、Googleマップで特定の領域(ポリゴン、円)をクリックすると、いくつかのスタイルで情報ウィンドウを開く必要があります。だから私は情報ボックスに移動しましたcss(jquery custom css ui lightness)を追加しました。そのインフォボックスに、時間とともにカレンダーを表示する必要があるため、多くのRDと書き込みコードを実行しました
描画ツール、infobox、jquery カスタム css、jquery-ui-timepicker を使用してコードを記述しました
今私の問題は、jquery-ui-timepicker がインフォボックスで発生していないことです。通常のdivで使用している場合、正常に機能します。
ここに私のコードの一部があります:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css" type="text/css" media="all" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.datetimepicker').datetimepicker({});
});
</script>
var contentString =
'<table width="100%"' +
'<tr>' + '<td width="18%">From Date:</input></td>' + '<td> <input class="datetimepicker" id="start_time" name="start_time" type="text" /></td>' + '<td width="18%" align="center">To Date:</input></td>' + '<td><input class="datetimepicker" id="end_time" name="end_time" type="text" /></td>' + '</tr>' +
'</table>'
function RaiseInfoWindow() {
google.maps.event.addListener(drawingModesType, 'click', function (event) {
if (infoBox)
infoBox.close();
var bounds = new google.maps.LatLngBounds();
message = GetMessage(drawingModesType);
InfoBoxType(InfoBox, message);
infoBox.setOptions({ content: message });
infoBox.setPosition(bounds.getCenter());
infoBox.open(map);
google.maps.event.addListener(infoBox, 'domready', function () {
jQuery("#tabs").tabs();
});
});
function GetMessage(polygon) {
coordinates = polygon.getPath().getArray();
message = ['<div id="tabs">', '<ul>', '<li><a href="#tab-1" ><span>Modify</span></a></li>', '<li><a href="#tab-2"><span>Save</span></a></li>', '</ul>',
'<div id="tab-1">', '<li><div style="color:#000" class="divText" >Approximately area is ' + GetAreaInAcres(polygon) + ' kms</div></li>', '<div class="divbuttonText"><p><input type="button" value="Edit" title="Edit" class="buttonStyle" onclick="ShapeEditable(true);" />' + " " + '<input type="button" value="Done" title="Done" class="buttonStyle" onclick="ShapeEditable(false);" />' + " " + '<input type="button" value="Delete" title="Delete" class="buttonStyle" onclick="DeleteShape(drawingModesType);" /></p></div>', '</div>',
'<div id="tab-2">', '<p>' + contentString + '</p>', '</div>', '</div>'].join('');
return message;
}
アップデート
JsFiddle Here is my Jsfiddle with my complete code (気が狂ったとは思わないでください。スクリプトの URL を追加しようとしましたが、機能しませんでした。非常に多くの jsfiddles を見ました (jquery-ui-timepicker アドオン .js で例が示されています)。また、同じ問題)スクリプトを追加しました.私のコードは2199行から始まります.前の行は無視してください)
アップデート2:
@gaurravの提案タイムピッカーを適用した後の私の更新されたフィドルは上昇していますが、2〜3回のクリック後に上昇しています