[英]popup click event not working
How to make jquery event after click on the link in the popup (appears after click on the marker). 单击弹出窗口中的链接后如何制作jquery事件(单击标记后出现)。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
</head>
<body>
<div id="map" style="width:500px;height:500px;">
<script>
var map = L.map('map').setView([54.6154, 18.8141], 7);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {maxZoom:18}).addTo(map);
L.marker([54.6154,18.8141]).addTo(map).bindPopup("<a href='#' class='A1'>link</a>");
</script>
</div>
<a href='#' class='A1'>link</a>
<script>
$( '.A1' ).click(function() {
alert('halo');
});
</script>
</body>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.