dropdown closes immediately once checkbox is ticked. so i am not able to choose second checkbox ticked at the same time.
function checkBox(options) { var self = this;
//first make the outer container
var container = document.createElement('DIV');
container.className = "checkboxContainer";
container.title = options.title;
var span = document.createElement('SPAN');
span.role = "checkbox";
span.className = "checkboxSpan";
var bDiv = document.createElement('DIV');
bDiv.className = "blankDiv";
bDiv.id = options.id;
var image = document.createElement('IMG');
image.className = "blankImg";
image.src = "http://ift.tt/17dMWy9";
var label = document.createElement('LABEL');
label.className = "checkboxLabel";
label.innerHTML = options.label;
self.checked = options.checked == null ? false : options.checked;
self.zoneId = options.zoneId == null ? null : options.zoneId;
bDiv.appendChild(image);
span.appendChild(bDiv);
container.appendChild(span);
container.appendChild(label);
google.maps.event.addDomListener(container,'click',function(){
if (document.getElementById(bDiv.id).style.display == 'block') {
document.getElementById(bDiv.id).style.display = 'none';
} else {
document.getElementById(bDiv.id).style.display = 'block';
}
self.checked = !self.checked;
options.action(self);
});
return container;
}
Aucun commentaire:
Enregistrer un commentaire