Jquery日期选择器不适用于Google Map InfoWindow [英] Jquery date picker not working with Google Map InfoWindow
本文介绍了Jquery日期选择器不适用于Google Map InfoWindow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何想法有什么可能是错误的?
代码:
var html =< table width ='250px'height =' 300像素>中+
....+
< tr>< td> Url:....+
< tr>< td> Date:< / td>< td>< input type ='text'id ='datepicker'/>< / td>< / tr> +
< tr>< td>< / td>< td>< input type ='button'value ='Save& Close'onclick ='saveData()'/><< ; / TD>< / TR>< /表>;
infowindow = new google.maps.InfoWindow({
content:html
});
我可以保存地图中的所有表单信息。但是datepicker不在地图内工作。
以及我正在使用的事件侦听器:
google.maps.event.addListener(map,click,function(event){
marker = new google.maps.Marker({
position:event .latLng,
map:map
));
google.maps.event.addListener(marker,click,function(){
$(#datepicker) .datepicker();
infowindow.open(map,marker);
});
});
任何人有任何想法?
: http://postimg.org/image/oe40y960z/
解决方案
您必须在domready中传递datepicker
以下是代码
infowindow.addListener('domready',function(){
$('。datepicker')。fdatepicker({
pickTime:true ,
});
});
Jquery ui datepicker is working outside the map but in the map the jquery ui datepicker not working.
Any Idea what could be wrong?
Code:
var html = "<table width='250px' height='300px'>" +
"...." +
"<tr><td>Url:...." +
"<tr><td>Date:</td> <td><input type='text' id='datepicker'/> </td> </tr>" +
"<tr><td></td><td><input type='button' value='Save & Close' onclick='saveData()'/></td></tr></table>";
infowindow = new google.maps.InfoWindow({
content: html
});
I can save all the form information from the map. But the datepicker is not working inside the map.
And the event listener i am using:
google.maps.event.addListener(map, "click", function(event) {
marker = new google.maps.Marker({
position: event.latLng,
map: map
});
google.maps.event.addListener(marker, "click", function() {
$( "#datepicker" ).datepicker();
infowindow.open(map, marker);
});
});
Anyone have any idea?
image: http://postimg.org/image/oe40y960z/
解决方案
You have to pass datepicker in domready
Below is the code
infowindow.addListener('domready', function() {
$('.datepicker').fdatepicker({
pickTime: true,
});
});
这篇关于Jquery日期选择器不适用于Google Map InfoWindow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文