-1
我試圖在Google地圖信息窗口中顯示圖像滑塊。但沒有錯誤,但滑塊不起作用。在谷歌地圖信息窗口中運行圖像滑塊
我想要做的和圖片一樣。
$(document).ready(function() { // runs jquery when document is ready
function initialize() {
var uluru = {
lat: -25.363,
lng: 131.044
};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: uluru
});
var contentString = '<div id="content"><ul id="slider"><li><img src="demos/images/slide-civil-1.jpg" alt=""></li><li><img src="demos/images/slide-env-1.jpg" alt=""></li><li><img src="demos/images/slide-civil-2.jpg" alt=""></li><li><img src="demos/images/slide-env-2.jpg" alt=""></li></ul></div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: uluru,
map: map,
title: 'Uluru (Ayers Rock)'
});
marker.addListener('click', function() {
infowindow.open(map, marker);
});
google.maps.event.addListener(infowindow, function() {
$('#slider').anythingSlider();
});
}
initialize();
});
(」 #slider')。anythingSlider();'在infowindow的'domready'事件上(你在你的事件監聽器中缺少事件名稱) – geocodezip
請使它成爲答案,我想給你+1並接受ans –
和誰給我-1。來這裏解釋理由 –