使用内联 CSS。
代替
.info-window {
width: 250px;
height: 230px;
}
采用:
// map info window
var contentString = '<div style="width:250px; height:230px;" class="info-window">' +
'<h3>Hi, we\'re Cuberis</h3>' +
'<table border="0" cellpadding="0" cellspacing="0" class="contact">' +
'<tr>' +
'<th scope="row">Email:</th>' +
'<td>info@cuberis.com</td>' +
'</tr>' +
'<tr>' +
'<th scope="row">Phone:</th>' +
'<td>919.443.2254</td>' +
'</tr>' +
'<tr>' +
'<th scope="row">Office:</th>' +
'<td>Golden Belt - Building 2<br />' +
'807 E. Main Street<br />' +
'Suite 2-210<br />' +
'Durham, NC 27701</td>' +
'</tr>' +
'</table>' +
'<div class="contact">' +
'<input type="button" class="button" value="See inside our office" onclick="toggleStreetView();"></input>' +
'</div>';
和:
// street view info window
var contentString2 = '<div style="width:250px; height:230px;" class="info-window">' +
'<h3>Hi, we\'re Cuberis</h3>' +
'<table border="0" cellpadding="0" cellspacing="0" class="contact">' +
'<tr>' +
'<th scope="row">Email:</th>' +
'<td>info@cuberis.com</td>' +
'</tr>' +
'<tr>' +
'<th scope="row">Phone:</th>' +
'<td>919.443.2254</td>' +
'</tr>' +
'<tr>' +
'<th scope="row">Office:</th>' +
'<td>Golden Belt - Building 2<br />' +
'807 E. Main Street<br />' +
'Suite 2-210<br />' +
'Durham, NC 27701</td>' +
'</tr>' +
'</table>' +
'<div class="contact">' +
'<input type="button" class="button" value="Check us out on the map" onclick="toggleStreetView();"></input>' +
'</div>';