0
我有以下代码,但我的流行并没有显示我的右键单击的确切位置如何请帮助。如何弹出显示我的右键点击详细的位置如何弹出显示确切的右键单击事件位置
function openPopup() {
//document.getElementById('test').style.display = 'block';
$('#test').fadeIn(1000);
}
function closePopup() {
//document.getElementById('test').style.display = 'none';
$('#test').fadeOut(500);
}
google.maps.event.addListener(_map, "rightclick", function (event) {
openPopup();
});
.popup {
position:fixed;
top:0px;
left:0px;
\t bottom:0px;
padding:10px;
background-color:rgb(240,240,240);
border:2px solid grey;
z-index:100000000000000000;
}
.cancel {
display:relative;
cursor:pointer;
margin:0;
float:right;
height:10px;
width:14px;
padding:0 0 5px 0;
z-index:100000000000000000;
}
.cancel:hover {
background:rgb(255,50,50);
}
<div id="test" class="popup" style="display:none;">
This is a test message
<div class="cancel" onclick="closePopup();"></div>
</div>
你甚至可以在哪里获得点击坐标? – Eric