Google Maps interfering is interferring with event listeners
I have a google map thats running on a webpage. When I load up the
webpage, I create a modal which expands and goes on top of the google
maps. I want to make is so that I can close the divs I made so that way I
can look at the google Maps. The problem is I believe that google's
listeners are interfering with my clicks. How should I get around this. A
little part of the code which I was working on:
.modalDialog {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.8);
z-index: 99999;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacitiy 400ms ease-in;
pointer-events: none;
}
.modalDialog:target {
opacity:0;
pointer-events: auto;
}
.modalDialog > div {
width: 400px;
height: 200px;
position: fixed;
left: 35%;
top: 50px;
margin: 10% auto;
padding: 4px 20px 13px 20px;
border-radius: 10px;
background: #fff;
background: -moz-linear-gradient(#fff,#999);
background: -o-linear-gradient(#fff, #999);
}
.close {
background: #606061;
top: -10px;
right: -10px;
color: #FFFFFF;
line-height: 25px;
right: -12px;
top: -10px;
position: absolute;
text-align: center;
width: 24px;
font-weight: bold;
text-decoration: none;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
box-shadow: 1px 1px 3px #000;
}
.close:hover {
background: #00d9ff;
}
On a separate js file:
window.onload = function createModal(){
var newDiv = document.createElement("div");
newDiv.setAttribute("id", "openModal");
newDiv.setAttribute("class", "modalDialog");
var modalDiv = document.createElement("div");
var close = document.createElement("a");
close.setAttribute("class", "close");
close.setAttribute("onclick", "hideWindows()");
var x = document.createTextNode("x");
modalDiv.appendChild(close);
newDiv.appendChild(modalDiv);//put the modal dialog in this div
var text = document.createTextNode("Testing this variable");
close.appendChild(x);
modalDiv.appendChild(text);
document.body.appendChild(newDiv);
};
No comments:
Post a Comment