Javascript [lightbox]未捕获的语法错误:意外的标识符
我有一些在FireFox和Chrome中工作的JavaScript代码。在ChromeJS控制台中,我得到以下错误:“uncaughtSyntaxError:意外标识符” 我使用的JavaScript代码是:Javascript [lightbox]未捕获的语法错误:意外的标识符,javascript,lightbox2,Javascript,Lightbox2,我有一些在FireFox和Chrome中工作的JavaScript代码。在ChromeJS控制台中,我得到以下错误:“uncaughtSyntaxError:意外标识符” 我使用的JavaScript代码是: function openBox(str, width, height) { if(!window.lightbox) { window.lightbox = this; this.width = width;
function openBox(str, width, height)
{
if(!window.lightbox) {
window.lightbox = this;
this.width = width;
this.height = height;
this.opacity = 0.1;
this.refresh = function()
{
this.background.setAttribute('style', 'background-color:black;opacity:'+ this.opacity +';z-index:999;position:absolute;top:0px;left:0px;width:'+ window.innerWidth +'px;height:'+ window.innerHeight +'px;');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (this.width / this.facteur) +'px;height:'+ (this.height / this.facteur) +'px;position:absolute;top:'+ ((window.innerHeight - (this.height / this.facteur)) / 2) +'px;left:'+ ((window.innerWidth - (this.width / this.facteur)) / 2) +'px;');
};
this.fondu = function(facteur)
{
if(window.lightbox) {
if(facteur == undefined) {
facteur = (this.state == 0) ? this.facteur : - this.facteur;
} if(Math.abs(facteur) > 1) {
var bfr_facteur = (facteur > 0) ? facteur - 0.1 : facteur + 0.1;;
this.opacity = this.opacity * facteur / bfr_facteur;
this.width = this.width * facteur / bfr_facteur;
this.height = this.height * facteur / bfr_facteur
this.refresh();
setTimeout(function()
{
window.lightbox.fondu(bfr_facteur);
}, 10);
} else {
if(this.state == 0) {
this.box.appendChild(this.text);
this.box.appendChild(this.close);
this.state = 1;
}
}
}
};
this.background = document.createElement('div');
document.body.appendChild(background);
this.box = document.createElement('div');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (width / 6) +'px;height:'+ (height / 6) +'px;position:absolute;left:'+ (screen.availWidth / 2 - (width / 3)) +'px;top:'+ (screen.availHeight / 2 - (width / 3)) +'px;');
this.background.appendChild(box);
this.text = document.createTextNode(str);
this.close = document.createElement('a');
this.close.setAttribute('href','#lightbox:close');
this.close.setAttribute('style','float:right;');
this.close.onclick = function() {
openBox.closeBox();
}
this.close.appendChild(document.createTextNode('Close [X]'));
this.state = 0;
this.facteur = 6;
this.fondu();
}
}
以及输入:
<a href="#lightbox:Bienvenue" onclick="openBox('Bienvenue sur mon site', 400, 250);return false" ><img src="./ICONE/contacts.png" title="Contacts" width="70" height="70"/>
如果在methode openBox中,则错误在firste行。Javascript代码:
function openBox(str, width, height)
{
if(!window.lightbox) {
window.lightbox = this;
this.width = width;
this.height = height;
this.opacity = 0.1;
this.refresh = function()
{
this.background.setAttribute('style', 'background-color:black;opacity:'+ this.opacity +';z-index:999;position:absolute;top:0px;left:0px;width:'+ window.innerWidth +'px;height:'+ window.innerHeight +'px;');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (this.width / this.facteur) +'px;height:'+ (this.height / this.facteur) +'px;position:absolute;top:'+ ((window.innerHeight - (this.height / this.facteur)) / 2) +'px;left:'+ ((window.innerWidth - (this.width / this.facteur)) / 2) +'px;');
};
this.fondu = function(facteur)
{
if(window.lightbox) {
if(facteur === undefined) {
facteur = (this.state === 0) ? this.facteur : - this.facteur;
} if(Math.abs(facteur) > 1) {
var bfr_facteur = (facteur > 0) ? facteur - 0.1 : facteur + 0.1;
this.opacity = this.opacity * facteur / bfr_facteur;
this.width = this.width * facteur / bfr_facteur;
this.height = this.height * facteur / bfr_facteur;
this.refresh();
setTimeout(function()
{
window.lightbox.fondu(bfr_facteur);
}, 10);
} else {
if(this.state === 0) {
this.box.appendChild(this.text);
this.box.appendChild(this.close);
this.state = 1;
}
}
}
};
this.background = document.createElement('div');
document.body.appendChild(background);
this.box = document.createElement('div');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (width / 6) +'px;height:'+ (height / 6) +'px;position:absolute;left:'+ (screen.availWidth / 2 - (width / 3)) +'px;top:'+ (screen.availHeight / 2 - (width / 3)) +'px;');
this.background.appendChild(box);
this.text = document.createTextNode(str);
this.close = document.createElement('a');
this.close.setAttribute('href','#lightbox:close');
this.close.setAttribute('style','float:right;');
this.close.onclick = function() {
openBox.closeBox();
};
this.close.appendChild(document.createTextNode('Close [X]'));
this.state = 0;
this.facteur = 6;
this.fondu();
}
}
<a href="#lightbox:Bienvenue" onclick="openBox('Bienvenue sur mon site', 400, 250);return false" ></a>
<img src="./ICONE/contacts.png" title="Contacts" width="70" height="70"/>
输入代码:
function openBox(str, width, height)
{
if(!window.lightbox) {
window.lightbox = this;
this.width = width;
this.height = height;
this.opacity = 0.1;
this.refresh = function()
{
this.background.setAttribute('style', 'background-color:black;opacity:'+ this.opacity +';z-index:999;position:absolute;top:0px;left:0px;width:'+ window.innerWidth +'px;height:'+ window.innerHeight +'px;');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (this.width / this.facteur) +'px;height:'+ (this.height / this.facteur) +'px;position:absolute;top:'+ ((window.innerHeight - (this.height / this.facteur)) / 2) +'px;left:'+ ((window.innerWidth - (this.width / this.facteur)) / 2) +'px;');
};
this.fondu = function(facteur)
{
if(window.lightbox) {
if(facteur === undefined) {
facteur = (this.state === 0) ? this.facteur : - this.facteur;
} if(Math.abs(facteur) > 1) {
var bfr_facteur = (facteur > 0) ? facteur - 0.1 : facteur + 0.1;
this.opacity = this.opacity * facteur / bfr_facteur;
this.width = this.width * facteur / bfr_facteur;
this.height = this.height * facteur / bfr_facteur;
this.refresh();
setTimeout(function()
{
window.lightbox.fondu(bfr_facteur);
}, 10);
} else {
if(this.state === 0) {
this.box.appendChild(this.text);
this.box.appendChild(this.close);
this.state = 1;
}
}
}
};
this.background = document.createElement('div');
document.body.appendChild(background);
this.box = document.createElement('div');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (width / 6) +'px;height:'+ (height / 6) +'px;position:absolute;left:'+ (screen.availWidth / 2 - (width / 3)) +'px;top:'+ (screen.availHeight / 2 - (width / 3)) +'px;');
this.background.appendChild(box);
this.text = document.createTextNode(str);
this.close = document.createElement('a');
this.close.setAttribute('href','#lightbox:close');
this.close.setAttribute('style','float:right;');
this.close.onclick = function() {
openBox.closeBox();
};
this.close.appendChild(document.createTextNode('Close [X]'));
this.state = 0;
this.facteur = 6;
this.fondu();
}
}
<a href="#lightbox:Bienvenue" onclick="openBox('Bienvenue sur mon site', 400, 250);return false" ></a>
<img src="./ICONE/contacts.png" title="Contacts" width="70" height="70"/>
我在来自openBox
的函数调用程序中遇到了相同的错误:
openBox.closeBox = function()
{
window.lightbox.box.innerHTML = "";
window.lightbox.fondu();
document.body.removeChild(window.lightbox.background);
window.lightbox = null;
};
我的网页是:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Control</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" media="screen">
<link href="assets/css/bootstrap-glyphicons.css" rel="stylesheet" media="screen">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="assets/js/jquery.tablesorter.min.js"></script>
<script src="assets/js/jquery.tablesorter.widgets.min.js"></script>
<script src="assets/js/date.js"></script>
<style type="text/css">
body {
background-image:url('assets/img/login_bg.png');
}
.main {
width: 98%;
height: 98%;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
outline: none;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
padding: 15px 15px 15px 15px;
}
.logo {
margin: 0 0 0 -140px;
height: 532px;
width: 200px;
z-index:-1;
position: absolute;
}
#func td {
padding: 2px 2px 2px 2px;
text-align: center;
}
.map {
width: 100%;
height: 82%;
margin-bottom: 5px;
}
#files td {
padding: 2px 2px 2px 2px;
text-align: center;
}
.row {
margin: 0 0 -5px 0;
}
.fullwidth {
width: 100%;
min-width: 135px;
}
.halfwidth {
width: 48%;
}
.addselection {
min-width: 30px;
}
.devicestable {
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
margin-bottom: 5px;
}
.functionslist {
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
margin-bottom: 5px;
}
.messageboxcontainer {
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
min-height: 185px;
max-height: 39%;
/* position: absolute; */
}
.filestable {
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
min-height: 185px;
max-height: 185px;
padding-top: 5px;
}
.mapcontainer {
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
min-height: 185px;
max-height: 39%;
padding: 5px 5px 5px 5px;
/* position: absolute; */
}
input {
text-align: center;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 0,
center: new google.maps.LatLng(0.0, 0.0),
disableDefaultUI: true,
panControl: false,
zoomControl: true,
scaleControl: false,
mapTypeId: google.maps.MapTypeId.HYBRID
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<script>
var selected=new Array();
var markersArray = [];
function gmapsmarker(location1, location2, title) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(location1, location2),
map: map,
animation: google.maps.Animation.DROP,
title: title
});
markersArray.push(marker);
}
function deleteOverlays() {
if (markersArray) {
for (i in markersArray) {
markersArray[i].setMap(null);
}
markersArray.length = 0;
}
}
function deleteMarker(deltitle) {
return markersArray.indexOf(deltitle);
}
function select(bot, lat, longi) {
if (document.getElementById(bot).innerHTML == '-') {
document.getElementById(bot).innerHTML = '+';
for(var i in selected){
if(selected[i]==bot){
selected.splice(i,1);
break;
}
}
document.getElementById("selectednumber").innerHTML = selected.length;
if (selected.length==0) {
document.getElementById("selectednumber").setAttribute("data-original-title", "None Selected");
deleteOverlays();
} else {
document.getElementById("selectednumber").setAttribute("data-original-title", selected.join(', '));
}
} else {
if (selected.indexOf(bot) == -1) {
selected.push(bot);
}
document.getElementById(bot).innerHTML = '-';
document.getElementById("selectednumber").innerHTML = selected.length;
document.getElementById("selectednumber").setAttribute("data-original-title", selected.join(', '));
gmapsmarker(lat, longi, bot);
}
}
function clearselection() {
for (var i=0;i<selected.length;i++) {
document.getElementById(selected[i]).innerHTML = '+';
}
selected.length = 0;
document.getElementById("selectednumber").innerHTML = selected.length;
document.getElementById("selectednumber").setAttribute("data-original-title", "None Selected");
deleteOverlays();
}
function selectall() {
selected = $("div.addbuttons > button").map(function(){
return this.id;
}).get();
var index = selected.indexOf(" ");
selected.splice(index, 1);
var index2 = selected.indexOf("");
selected.splice(index2, 1);
for (var i=0;i<selected.length;i++) {
document.getElementById(selected[i]).onclick();
}
document.getElementById("selectednumber").innerHTML = selected.length;
document.getElementById("selectednumber").setAttribute("data-original-title", selected.join(', '));
}
function getHistory(uid) {
if (uid=="") {
document.getElementById("historyof").innerHTML = "All Bots";
} else {
document.getElementById("historyof").innerHTML = uid;
}
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("messages").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getmessages.php?uid="+uid,true);
xmlhttp.send();
}
function addCommand(command, arg1, arg2) {
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
if (xmlhttp.responseText=="Success"){
alert("Command Added");
} else {
alert(xmlhttp.responseText);
}
}
}
xmlhttp.open("GET","addcommand.php?uid="+selected+"&command="+command+"&arg1="+arg1+"&arg2="+arg2,true);
xmlhttp.send();
}
var refresh;
var scroll;
<?php if($autoscrolltextbox){ echo "scroll='auto'"; } else { echo "scroll='manual'"; } ?>
function updateScroll() {
if (scroll=='auto'){
scroll='manual';
document.getElementById("autoscrollbutton").innerHTML="Auto Scroll: Off";
} else {
scroll='auto';
document.getElementById("autoscrollbutton").innerHTML="Auto Scroll: On";
}
}
function autoScroll(){
if (scroll=='auto'){
var elem = document.getElementById('messagebox');
elem.scrollTop = elem.scrollHeight;
} else {
}
}
function autorefresh(uid) {
refresh = setInterval(function() { getHistory(uid); autoScroll(); }, <?php echo $messageboxrefreshspeed; ?>);
}
function stoprefresh() {
window.clearInterval(window.refresh);
}
function viewCommands() {
stoprefresh();
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("messages").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getwaitingcommands.php",true);
xmlhttp.send();
}
function fixSelected() {
$.each(selected, function(index, value) {
document.getElementById(value).innerHTML = '-';
});
}
function refreshTable() {
$('#tablefill').load('table.php', function(){
fixSelected();
});
}
function refreshFileTable() {
$('#filetablefill').load('filetable.php', function(){
});
}
function refreshImages() {
$('#replaceimages').load('showpictures.php?uid='+uid, function(){
var sliderval=document.getElementById('defaultSlider').value;
$('.getimgimg').width(sliderval+'px');
});
}
function getImages() {
uid = $("#modaluid").val();
startdate = $("#modalstarttime").val();
enddate = $("#modalendtime").val();
filesize = $("#modalfilesize").val();
fixstartdate = Date.parse(startdate).getTime()/1000;
fixenddate = Date.parse(enddate).getTime()/1000;
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
}
}
xmlhttp.open("GET","getimages.php?uid="+uid+"&start="+fixstartdate+"&end="+fixenddate+"&filesize="+filesize,true);
xmlhttp.send();
refreshImages();
imgrefresh = setInterval(refreshImages, 2000);
}
function deletePics(uid) {
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
alert(xmlhttp.responseText);
}
}
xmlhttp.open("GET","deletepics.php?uid="+uid,true);
xmlhttp.send();
}
$(function(){
$('#defaultSlider').change(function(){
$('.getimgimg').width(this.value);
});
$('#defaultSlider').change();
});
</script>
<script src="assets/js/lightbox/lightbox.js"></script>
<script src="assets/js/lightbox/lightbox.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
if ($("[rel=tooltip]").length) {
$("[rel=tooltip]").tooltip();
}
refreshTable();
refreshFileTable();
getHistory("");
autorefresh("");
setInterval(refreshTable, <?php echo $devicestablerefreshspeed; ?>);
setInterval(refreshFileTable, <?php echo $filestablerefreshspeed; ?>);
});
function openBox(str, width, height)
{
if(!window.lightbox) {
window.lightbox = this;
this.width = width;
this.height = height;
this.opacity = 0.1;
this.refresh = function()
{
this.background.setAttribute('style', 'background-color:black;opacity:'+ this.opacity +';z-index:999;position:absolute;top:0px;left:0px;width:'+ window.innerWidth +'px;height:'+ window.innerHeight +'px;');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (this.width / this.facteur) +'px;height:'+ (this.height / this.facteur) +'px;position:absolute;top:'+ ((window.innerHeight - (this.height / this.facteur)) / 2) +'px;left:'+ ((window.innerWidth - (this.width / this.facteur)) / 2) +'px;');
};
this.fondu = function(facteur)
{
if(window.lightbox) {
if(facteur == undefined) {
facteur = (this.state == 0) ? this.facteur : - this.facteur;
} if(Math.abs(facteur) > 1) {
var bfr_facteur = (facteur > 0) ? facteur - 0.1 : facteur + 0.1;;
this.opacity = this.opacity * facteur / bfr_facteur;
this.width = this.width * facteur / bfr_facteur;
this.height = this.height * facteur / bfr_facteur
this.refresh();
setTimeout(function()
{
window.lightbox.fondu(bfr_facteur);
}, 10);
} else {
if(this.state == 0) {
this.box.appendChild(this.text);
this.box.appendChild(this.close);
this.state = 1;
}
}
}
};
this.background = document.createElement('div');
document.body.appendChild(background);
this.box = document.createElement('div');
this.box.setAttribute('style', 'background-color:white;z-index:9999;width:'+ (width / 6) +'px;height:'+ (height / 6) +'px;position:absolute;left:'+ (screen.availWidth / 2 - (width / 3)) +'px;top:'+ (screen.availHeight / 2 - (width / 3)) +'px;');
this.background.appendChild(box);
this.text = document.createTextNode(str);
this.close = document.createElement('a');
this.close.setAttribute('href','#lightbox:close');
this.close.setAttribute('style','float:right;');
this.close.onclick = function() {
openBox.closeBox();
}
this.close.appendChild(document.createTextNode('Close [X]'));
this.state = 0;
this.facteur = 6;
this.fondu();
}
}
openBox.closeBox = function()
{
window.lightbox.box.innerHTML = "";
window.lightbox.fondu();
document.body.removeChild(window.lightbox.background);
window.lightbox = null;
};
</script>
</head>
<body style="width: 100%; height: 100%;">
<div class="main">
<div class="row" style="height:60%;">
<div class="col-lg-9 devicestable" style="height:100%; min-height:380px; padding-top: 5px; overflow:auto;">
<div id="tablefill"></div>
</div>
<div class="modal fade" id="imageModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">View Images</h4>
</div>
<div class="modal-body">
<p>UID</p>
<input class="form-control input-small" id="modaluid" type="text" value="">
<p>Start Date</p>
<input class="form-control input-small" id="modalstarttime" type="date" placeholder="Start Date">
<p>End Date</p>
<input class="form-control input-small" id="modalendtime" type="date" placeholder="End Date">
<p>Max File Size</p>
<input class="form-control input-small" id="modalfilesize" type="text" placeholder="Max File Size in MB">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#displayImages" data-dismiss="modal" onclick="getImages();">View Images</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="displayImages">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 style="display:inline;" class="modal-title">Images</h4> <input id="defaultSlider" type="range" min="100" max="520" />
</div>
<div class="modal-body">
<div id="replaceimages"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="window.clearInterval(window.imgrefresh);" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="col-lg-3 functionslist" style="height:100%; min-height:400px; padding-top: 5px; overflow:auto;">
<table class="table" id="func">
<tr>
<td>
<!-- contact -->
<div><a href="#lightbox:Bienvenue" onclick="openBox('Bienvenue sur mon site', 400, 250);return false" ><img src="./ICONE/contacts.png" title="Contacts" width="70" height="70"/></a></div>
<!-- <button type="button"
onclick="addCommand('ringervolumeup')" class="btn btn-default btn-small fullwidth">Ringer Up</button> -->
</td>
</tr>
</table>
</div>
</div>
</div>
<script src="assets/js/bootstrap.min.js"></script>
<script>
$(document).ready(function()
{
$("#files").tablesorter();
}
);
</script>
</body>
</html>
控制
身体{
背景图片:url('assets/img/login_bg.png');
}
梅因先生{
宽度:98%;
身高:98%;
背景色:#ffffff;
边框:1px实心#999999;
边框:1px实心rgba(0,0,0,0.2);
边界半径:6px;
大纲:无;
-webkit盒阴影:0 3px 9px rgba(0,0,0,0.5);
盒影:0 3px 9px rgba(0,0,0,0.5);
位置:绝对位置;
排名:0;
底部:0;
左:0;
右:0;
保证金:自动;
填充:15px 15px 15px 15px;
}
.标志{
利润率:0-140px;
身高:532px;
宽度:200px;
z指数:-1;
位置:绝对位置;
}
#func td{
填充:2×2×2×2×2×2;
文本对齐:居中;
}
.地图{
宽度:100%;
身高:82%;
边缘底部:5px;
}
#文件td{
填充:2×2×2×2×2×2;
文本对齐:居中;
}
.行{
边距:0 0-5px0;
}
.全宽{
宽度:100%;
最小宽度:135px;
}
半幅{
宽度:48%;
}
.addselection{
最小宽度:30px;
}
.设备表{
边框:1px实心#999999;
边框:1px实心rgba(0,0,0,0.2);
边界半径:6px;
边缘底部:5px;
}
.功能列表{
边框:1px实心#999999;
边框:1px实心rgba(0,0,0,0.2);
边界半径:6px;
边缘底部:5px;
}
.messageboxcontainer{
边框:1px实心#999999;
边框:1px实心rgba(0,0,0,0.2);
边界半径:6px;
最小高度:185px;
最高高度:39%;
/*位置:绝对位置*/
}
.filestable{
边框:1px实心#999999;
边框:1px实心rgba(0,0,0,0.2);
边界半径:6px;
最小高度:185px;
最大高度:185像素;
垫面:5px;
}
.mapcontainer{
边框:1px实心#999999;
边框:1px实心rgba(0,0,0,0.2);
边界半径:6px;
最小高度:185px;
最高高度:39%;
填充物:5px 5px 5px;
/*位置:绝对位置*/
}
输入{
文本对齐:居中;
}
var映射;
函数初始化(){
变量映射选项={
缩放:0,
中心:新的google.maps.LatLng(0.0,0.0),
disableDefaultUI:true,
泛控制:错误,
动物控制:对,
scaleControl:false,
mapTypeId:google.maps.mapTypeId.HYBRID
};
map=new google.maps.map(document.getElementById('map-canvas'),
地图选项);
}
google.maps.event.addDomListener(窗口“加载”,初始化);
所选变量=新数组();
var-markersArray=[];
功能gmapsmarker(位置1、位置2、标题){
var marker=new google.maps.marker({
位置:新google.maps.LatLng(位置1,位置2),
地图:地图,
动画:google.maps.animation.DROP,
标题:标题
});
markersArray.push(marker);
}
函数deleteOverlays(){
if(markersArray){
for(markersArray中的i){
markersArray[i].setMap(空);
}
markersArray.length=0;
}
}
函数deleteMarker(deltitle){
返回markersArray.indexOf(deltitle);
}
功能选择(bot、lat、longi){
if(document.getElementById(bot.innerHTML='-')){
document.getElementById(bot.innerHTML='+';
对于(所选中的var i){
如果(所选[i]==bot){
选择。拼接(i,1);
打破
}
}
document.getElementById(“selectednumber”).innerHTML=selected.length;
如果(选定。长度==0){
document.getElementById(“selectednumber”).setAttribute(“数据原始标题”,“未选择”);
deleteOverlays();
}否则{
document.getElementById(“selectednumber”).setAttribute(“数据原始标题”,selected.join(“,”);
}
}否则{
如果(已选择。indexOf(bot)=-1){
选择。推送(bot);
}
document.getElementById(bot.innerHTML='-';
document.getElementById(“selectednumber”).innerHTML=selected.length;
document.getElementById(“selectednumber”).setAttribute(“数据原始标题”,selected.join(“,”);
gmapsmarker(横向、纵向、纵向);
}
}
函数{
对于(var i=0;i);
});
函数openBox(str、宽度、高度)
{
如果(!window.lightbox){
window.lightbox=this;
这个。宽度=宽度;
高度=高度;
该值为0.1;
this.refresh=函数()
{
this.background.setAttribute('style','background color:black;opacity:'+this.opacity+';z索引:999;位置:绝对;顶部:0px;左侧:0px;宽度:'+window.innerWidth+'px;高度:'+window.innerHeight+'px;');
this.box.setAttribute('style','background color:white;z-index:9999;width:'+(this.width/this.facteur)+'px;height:'+(this.height/this.facteur)+'px;position:absolute;top:'+((window.innerHeight-(this.height/this.facteur))/2)+'px;left:'+((window.innerWidth)-