gpt4 book ai didi

javascript - 将 infoBox 替换为 jquery 对话框模式窗口

转载 作者:太空宇宙 更新时间:2023-11-03 18:36:22 26 4
gpt4 key购买 nike

我这里有一张 map 、标记和信息框。

现在我想用 jquery dialog() 和模态窗口更改信息框...我该怎么做?

这是我的信息框代码

 google.maps.event.addListener(marker,'click',function(){

service.getDetails(request, function(place, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
var contentStr = '<div class="m_tooltip"><h5>'+place.name+'</h5><p>'+place.formatted_address+'</p>';
if (!!place.formatted_phone_number) contentStr += '<br>'+place.formatted_phone_number;
if (!!place.website) contentStr += '<br><a target="_blank" href="'+place.website+'">'+place.website+'</a>';
if (!!place.photos) contentStr += '<img src='+place.photos[0].getUrl({ 'maxWidth': 300, 'maxHeight': 300 })+'></img>';
contentStr += '<br>'+place.types+'</p>';


//contentStr += '<h5">'+place.reviews[0].text+'</h5></div>';
ib.setContent(contentStr);
ib.open(map,marker);

} else {
var contentStr = "<h5>No Result, status="+status+"</h5>";
ib.setContent(contentStr);
ib.open(map,marker);
}
});

});

gmarkers.push(marker);

现在我想用对话框改变这个...

我尝试:

$(function() {
$( ".m_tooltip" ).dialog({
resizable: false,
height:140,
modal: true
});
});

但这行不通...请帮忙

最佳答案

google.maps.event.addListener(marker,'click',function(){
service.getDetails(request, function(place, status) {
var content= '<h1>'+place.name+'</h1>';//and add all what you want
$(content).dialog();
});
});

关于javascript - 将 infoBox 替换为 jquery 对话框模式窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18596088/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com