📄 destineshowposition.js
字号:
// JScript 文件
var DestineStyle = "color:Green;";
var CheckingStyle = "color:Red;";
var EmptyStyle = "color:Blue;";
function PageInit()
{
var imgMap = GetElementById("ImgMap");
for (var i = 0; i < ShowPositionList.length; i++)
{
var sp = ShowPositionList[i];
var num = i;
var style = "";
if (sp.OrderId > 0)
{
style = CheckingStyle;
}
else
{
style = EmptyStyle;
}
GetElementById("ShowPositionPanel").insertAdjacentHTML("beforeEnd","<div class=\"ShowPosition\" style=\"" + style + "\" id=\"SP" + num + "\" Num=\"" + num + "\" onclick=\"DestineShowPosition(this);\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout();\">" + sp.Name + "</div>");
var divSp = GetElementById("SP" + num);
divSp.style.left = GetBrowserPositionX(imgMap) + parseInt(sp.PointX);
divSp.style.top = GetBrowserPositionY(imgMap) + parseInt(sp.PointY);
divSp.style.height = sp.Height;
divSp.style.width = sp.Width;
}
}
function ResizeWindow()
{
var imgMap = GetElementById("ImgMap");
for (var i = 0; i < ShowPositionList.length; i++)
{
var sp = ShowPositionList[i];
var num = i;
var style = "";
if (sp.OrderId > 0)
{
style = CheckingStyle;
}
else
{
style = EmptyStyle;
}
var divSp = GetElementById("SP" + num);
divSp.style.left = GetBrowserPositionX(imgMap) + parseInt(sp.PointX);
divSp.style.top = GetBrowserPositionY(imgMap) + parseInt(sp.PointY);
divSp.style.height = sp.Height;
divSp.style.width = sp.Width;
}
}
function DestineShowPosition(obj)
{
var num = parseInt(obj.Num);
var sp = ShowPositionList[num];
if (sp.OrderId == 0)
{
document.URL = "DestineInfo.aspx?spid=" + sp.Id + "&mpid=" + GetElementById("HidMeetingPlaceId").value;
}
}
function mouseover(obj)
{
var num = parseInt(obj.Num);
var sp = ShowPositionList[num];
var info = "";
info += "状态:";
if (sp.OrderId > 0)
{
info += "<span style=\"" + CheckingStyle + "\">已被预定</span><br />";
info += "公司名称:<span style=\"font-weight:bold;" + CheckingStyle + "\">" + sp.Company + "</span><br />";
}
else
{
info += "<span style=\"" + EmptyStyle + "\">空位,单击进入预定页面</span><br />";
}
if (parseFloat(sp.Price) > 0)
{
info += "价格:<span style=\"color:red;\">" + sp.Price + "</span>";
}
var divInfo = GetElementById("DivInfo");
divInfo.style.display = "block";
divInfo.style.left = GetBrowserPositionX(obj);
divInfo.style.top = GetBrowserPositionY(obj) + 20;
divInfo.innerHTML = info;
}
function mouseout()
{
GetElementById("DivInfo").style.display = "none";
}
window.onresize = function()
{
ResizeWindow();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -