0
我用Leaflet製作了一張地圖。這張地圖由點組成;當用戶點擊一個點時,它會打開一個彈出窗口,其中包含一個信息和一個鏈接,用於在新頁面中打開表單。這個很不錯。
現在我希望鏈接在iframe中打開,而不是在新頁面中打開。我想使用FancyBox。打開Fancybox Iframe,點擊傳單彈出框中的鏈接
要做到這一點,我把鏈接的fancybox在我的html頁面(我有版本的jQuery 1.9.1):
<link rel="stylesheet" href="/maquette/css/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<script type="text/javascript" src="/maquette/biblio/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#various3").fancybox({
'width' : '95%',
'height' : '95%',
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
});
</script>
HTML文件調用JS文件,在其中我建立我的地圖。 我配置了彈出這樣的:
var pl = L.geoJson(ptslum, {
pointToLayer: function (feature, latLng) {
return new L.Marker(latLng, {
icon: new myIcon({
iconUrl: '/maquette/css/iconPL2.png'
})
}).bindPopup("<b><center><FONT color = 999999> La référence du point lumineux sélectionné est </b>" + "<b>" + feature.properties.pl_ref_sdeer + "</b></FONT><br><br>"
+ "<a class = \"iframe\" href = \"form/declapanne.php?id=" + feature.properties.pl_ref_sdeer + "\"> Cliquer pour déclarer la panne</a></center> "
);
}
});
但沒有任何反應:形式始終處於一個新的頁面..
你知道如何使單張及的fancybox之間的聯繫?
謝謝!
這聽起來更像是配置正確的鏈接來做你想做的事情的問題。標記彈出窗口顯示一些常規的HTML內容,所以我懷疑Leaflet與你的問題有關。 – ghybs