0
我使用初学者turtorial(通过Mano Marks/Google)关于GMaps自动填充方法的代码。现在一切工作正常,但是我不知道如何更改自动填充框中的建议字符串的颜色,该框被调整为我的输入字段 我想这样做,因为默认颜色似乎是白色的!如何更改自动填充输入框(GMaps API v3)的文本颜色
有人知道如何改变颜色!非常感谢。 下面是代码:
HTML:
Suche:<input type="text" id="autocomplete" size="40" />
......
JS:
//Autocomplete
var acOptions = {
types:['establishment'],
};
var autocomplete =
new google.maps.places.Autocomplete(document.getElementById('autocomplete'),acOptions);
autocomplete.bindTo('bounds',map);
var ac_iw = new google.maps.InfoWindow();
var ac_marker = new google.maps.Marker({
map: map
});
google.maps.event.addListener(autocomplete,'place_changed',function(){
ac_iw.close();
var place = autocomplete.getPlace();
if(place.geometry.viewport){
map.fitBounds(place.geometry.viewport);
}
else{
map.setCenter(place.geometry.location);
map.setZoom(17);
}
ac_marker.setPosition(place.geometry.location);
ac_iw.setContent('<strong>' + place.name + '</strong><br/>');
ac_iw.open(map,ac_marker);
google.maps.event.addListener(ac_marker,'click',function(){
ac_iw.open(map,ac_marker);
});
});
这是否意味着白色文本是gmaps自动完成对象的默认值? – user1953346 2013-03-10 23:43:33
这意味着白色文本颜色必须是您的作者CSS(为您的页面定义的CSS)或用户CSS(为您的浏览器定义的默认样式)的结果 – 2013-03-11 08:20:25
啊,谢谢,自动填充盒似乎可以从身体标记中获取文本颜色。 – user1953346 2013-03-12 05:36:20