<html>
<head>
<title>Ajaxian Maps</title>
<style type="text/css">
h1{
font:20pt sans-serif;
}
#outerDiv{
height:600px;
width:800px;
border:1px solid black;
position:relative;
overflow:hidden;
}
#innerDiv{
position:relative;
left:0px;
top:0px;
}
#toggleZoomDiv{
position:absolute;
top:10px;
left:10px;
z-index:1
width:72px;
height:30px;
}
#togglePushPinDiv{
position:absolute;
top:10px;
left:87px;
z-index:1;
width:72px;
height:30px
}
</style>
<script language="javascript" src="/UploadFiles/2021-04-02/browserdetect_lite.js"> <script language="javascript" src="resource/js/opacity.js"> <script type="text/javascript" language="javascript">
//常数
var viewportWidth=800;
var viewportHeight=600;
var tileSize=100;
var zoom=0;
var zoomSizes=[["2000px","1400px"],["1500px","1050px"]];
//用来控制地图div的移动
var dragging=false;
var top;
var left;
var dragStartTop;
var dragStartLeft;
function init(){
//让inner div足够大,以正确显示出地图
setInnerDivSize(zoomSizes[zoom][0],zoomSizes[zoom][1]);
//为拖曳操作绑定鼠标监听器
var outerDiv=document.getElementById("outerDiv");
outerDiv.onmousedown=startMove;
outerDiv.onmousemove=processMove;
outerDiv.onmouseup=stopMove;
//在IE中支持拖曳所必须
outerDiv.ondragstart=function()
{ return false;}
//解决在IE中触发器div的透明度问题
new OpacityObject('toggleZoomDiv','resource/images/zoom').setBackground();
new OpacityObject('togglePushPinDiv','resource/images/pushpin').setBackground();
checkTiles();
}
function startMove(event){
//针对IE必需
if(!event)event=window.event;
dragStartLeft=event.clientX;
dragStartTop=event.clientY;
var innerDiv=document.getElementById("innerDiv");
innerDiv.style.cursor="-moz-grab";
top=stripPx(innerDiv.style.top);
left=stripPx(innerDiv.style.left);
dragging=true;
return false;
}
function processMove(event){
if(!event)event=window.event; //for IE
var innerDiv=document.getElementById("innerDiv");
if(dragging){
innerDiv.style.top=parseFloat(top)+(event.clientY-dragStartTop);
innerDiv.style.left=parseFloat(left)+(event.clientX-dragStartLeft);
}
checkTiles();
}
function checkTiles(){
//检查在inner div中将显示哪个标题
var visibleTiles=getVisibleTiles();
//当把每个小地图快添加到inner div中时,要先检查其是否已经添加
var innerDiv=document.getElementById("innerDiv");
var visibleTilesMap={};
for (i=0;i<visibleTiles.length ;i++)
{
var tileArray=visibleTiles[i];
var tileName="x"+tileArray[0]+"y"+tileArray[1]+"z"+zoom;
visibleTilesMap[tileName]=true;
var img=document.getElementById(tileName);
if(!img){
img=document.createElement("img");
img.src="/UploadFiles/2021-04-02/"> img.style.position="absolute";
img.style.left=(tileArray[0]*tileSize)+"px";
img.style.top=(tileArray[1]*tileSize)+"px";
img.style.zIndex=0;
img.setAttribute("id",tileName);
innerDiv.appendChild(img);
}
}
var imgs=innerDiv.getElementByTagName("img");
for(i=0;i<imgs.length;i++){
var id=imgs[i].getAttribute("id");
if(!visibleTilesMap[id]){
innerDiv.removeChild(imgs[i]);
i--;//compensate for live nodeslist
}
}
}
function getVisibleTiles(){
var innerDiv=document.getElementById("innerDiv");
var mapX=stripPx(innerDiv.style.left);
var mapY=stripPx(innerDiv.style.top);
var startX=Math.abs(Math.floor(mapX/tileSize))-1;
var startY=Math.abs(Math.floor(mapY/tileSize))-1;
var tilesX=Math.ceil(viewportWidth/tileSize)+1;
var tilesY=Math.ceil(viewportHeight/tileSize)+1;
var visibleTileArray=[];
var counter=0;
for(x=startX;x<(tilesX+startX);x++){
for(y=startY;y<(tilesY+startY);y++){
visibleTileArray[counter++]=[x,y];
}
}
return visibleTileArray;
}
function stopMove(){
var innerDiv=document.getElementById("innerDiv");
innerDiv.style.cursor="";
dragging=false;
}
function stripPx(value){
if(value=="")return 0;
return parseFloat(value.substring(0,value.length-2));
}
function setInnerDivSize(width,height){
var innerDiv=document.getElementById("innerDiv");
innerDiv.style.width=width;
innerDiv.style.height=height;
}
function toggleZoom(){
zoom=(zoom==0)?1:0;
var innerDiv=document.getElementById("innerDiv");
var imgs=innerDiv.getElementsByTagName("img");
while(imgs.length>0)innerDiv.removeChild(imgs[0]);
setInnerDivSize(zoomSizes[zoom][0],zoomSizes[zoom][1]);
if(document.getElementById("pushPin"))togglePushPin();
checkTiles();
}
function togglePushPin(){
var pinImage=document.getElementById("pushPin");
if(pinImage){
pinImage.parentNode.removeChild(pinImage);
var dialog=document.getElementById("pinDialog");
dialog.parentNode.removeChild(dialog);
return;
}
var innerDiv=document.getElementById("innerDiv");
pinImage=document.createElement("div");
pinImage.style.position="absolute";
pinImage.style.left=(zoom==0)?"850px":"630px";
pinImage.style.top=(zoom==0)?"570px":"420px";
pinImage.style.width="37px";
pinImage.style.height="34px";
pinImage.zIndex=1;
pinImage.setAttribute("id","pushPin");
innerDiv.appendChild(pinImage);
new OpacityObject("pubshPin","resource/images/pin").setBackground();
var dialog=document.createElement("div");
dialog.style.position="absolute";
dialog.style.left=(stripPx(pinImage.style.left)-90)+"px";
dialog.style.top=(stripPx(pinImage.style.top)-210)+"px";
dialog.style.width="309px";
dialog.style.height="229px";
dialog.style.zIndex=2;
dialog.setAttribute("id","pinDialog");
dialog.innerHTML="<table height='80%' width='100%'>"+"<tr><td align='center'>The capital of Spain</td></tr></table>";
innerDiv.appendChild(dialog);
new OpacityObject('pinDialog','resource/images/dialog').setBackground();
}
</script>
</head>
<body onload="init()">
<p>
<h1>Ajaxian Maps</h1>
</p>
<div id="outerDiv">
<div id="toggleZoomDiv" onclick="toggleZoom()">
</div>
<div id="togglePushPinDiv" onclick="togglePushPin()">
</div>
<div id="innerDiv" style="z-index:0">
The rain in Spain falls mainly in the plains.
</div>
</div>
</body>
</html>
<head>
<title>Ajaxian Maps</title>
<style type="text/css">
h1{
font:20pt sans-serif;
}
#outerDiv{
height:600px;
width:800px;
border:1px solid black;
position:relative;
overflow:hidden;
}
#innerDiv{
position:relative;
left:0px;
top:0px;
}
#toggleZoomDiv{
position:absolute;
top:10px;
left:10px;
z-index:1
width:72px;
height:30px;
}
#togglePushPinDiv{
position:absolute;
top:10px;
left:87px;
z-index:1;
width:72px;
height:30px
}
</style>
<script language="javascript" src="/UploadFiles/2021-04-02/browserdetect_lite.js"> <script language="javascript" src="resource/js/opacity.js"> <script type="text/javascript" language="javascript">
//常数
var viewportWidth=800;
var viewportHeight=600;
var tileSize=100;
var zoom=0;
var zoomSizes=[["2000px","1400px"],["1500px","1050px"]];
//用来控制地图div的移动
var dragging=false;
var top;
var left;
var dragStartTop;
var dragStartLeft;
function init(){
//让inner div足够大,以正确显示出地图
setInnerDivSize(zoomSizes[zoom][0],zoomSizes[zoom][1]);
//为拖曳操作绑定鼠标监听器
var outerDiv=document.getElementById("outerDiv");
outerDiv.onmousedown=startMove;
outerDiv.onmousemove=processMove;
outerDiv.onmouseup=stopMove;
//在IE中支持拖曳所必须
outerDiv.ondragstart=function()
{ return false;}
//解决在IE中触发器div的透明度问题
new OpacityObject('toggleZoomDiv','resource/images/zoom').setBackground();
new OpacityObject('togglePushPinDiv','resource/images/pushpin').setBackground();
checkTiles();
}
function startMove(event){
//针对IE必需
if(!event)event=window.event;
dragStartLeft=event.clientX;
dragStartTop=event.clientY;
var innerDiv=document.getElementById("innerDiv");
innerDiv.style.cursor="-moz-grab";
top=stripPx(innerDiv.style.top);
left=stripPx(innerDiv.style.left);
dragging=true;
return false;
}
function processMove(event){
if(!event)event=window.event; //for IE
var innerDiv=document.getElementById("innerDiv");
if(dragging){
innerDiv.style.top=parseFloat(top)+(event.clientY-dragStartTop);
innerDiv.style.left=parseFloat(left)+(event.clientX-dragStartLeft);
}
checkTiles();
}
function checkTiles(){
//检查在inner div中将显示哪个标题
var visibleTiles=getVisibleTiles();
//当把每个小地图快添加到inner div中时,要先检查其是否已经添加
var innerDiv=document.getElementById("innerDiv");
var visibleTilesMap={};
for (i=0;i<visibleTiles.length ;i++)
{
var tileArray=visibleTiles[i];
var tileName="x"+tileArray[0]+"y"+tileArray[1]+"z"+zoom;
visibleTilesMap[tileName]=true;
var img=document.getElementById(tileName);
if(!img){
img=document.createElement("img");
img.src="/UploadFiles/2021-04-02/"> img.style.position="absolute";
img.style.left=(tileArray[0]*tileSize)+"px";
img.style.top=(tileArray[1]*tileSize)+"px";
img.style.zIndex=0;
img.setAttribute("id",tileName);
innerDiv.appendChild(img);
}
}
var imgs=innerDiv.getElementByTagName("img");
for(i=0;i<imgs.length;i++){
var id=imgs[i].getAttribute("id");
if(!visibleTilesMap[id]){
innerDiv.removeChild(imgs[i]);
i--;//compensate for live nodeslist
}
}
}
function getVisibleTiles(){
var innerDiv=document.getElementById("innerDiv");
var mapX=stripPx(innerDiv.style.left);
var mapY=stripPx(innerDiv.style.top);
var startX=Math.abs(Math.floor(mapX/tileSize))-1;
var startY=Math.abs(Math.floor(mapY/tileSize))-1;
var tilesX=Math.ceil(viewportWidth/tileSize)+1;
var tilesY=Math.ceil(viewportHeight/tileSize)+1;
var visibleTileArray=[];
var counter=0;
for(x=startX;x<(tilesX+startX);x++){
for(y=startY;y<(tilesY+startY);y++){
visibleTileArray[counter++]=[x,y];
}
}
return visibleTileArray;
}
function stopMove(){
var innerDiv=document.getElementById("innerDiv");
innerDiv.style.cursor="";
dragging=false;
}
function stripPx(value){
if(value=="")return 0;
return parseFloat(value.substring(0,value.length-2));
}
function setInnerDivSize(width,height){
var innerDiv=document.getElementById("innerDiv");
innerDiv.style.width=width;
innerDiv.style.height=height;
}
function toggleZoom(){
zoom=(zoom==0)?1:0;
var innerDiv=document.getElementById("innerDiv");
var imgs=innerDiv.getElementsByTagName("img");
while(imgs.length>0)innerDiv.removeChild(imgs[0]);
setInnerDivSize(zoomSizes[zoom][0],zoomSizes[zoom][1]);
if(document.getElementById("pushPin"))togglePushPin();
checkTiles();
}
function togglePushPin(){
var pinImage=document.getElementById("pushPin");
if(pinImage){
pinImage.parentNode.removeChild(pinImage);
var dialog=document.getElementById("pinDialog");
dialog.parentNode.removeChild(dialog);
return;
}
var innerDiv=document.getElementById("innerDiv");
pinImage=document.createElement("div");
pinImage.style.position="absolute";
pinImage.style.left=(zoom==0)?"850px":"630px";
pinImage.style.top=(zoom==0)?"570px":"420px";
pinImage.style.width="37px";
pinImage.style.height="34px";
pinImage.zIndex=1;
pinImage.setAttribute("id","pushPin");
innerDiv.appendChild(pinImage);
new OpacityObject("pubshPin","resource/images/pin").setBackground();
var dialog=document.createElement("div");
dialog.style.position="absolute";
dialog.style.left=(stripPx(pinImage.style.left)-90)+"px";
dialog.style.top=(stripPx(pinImage.style.top)-210)+"px";
dialog.style.width="309px";
dialog.style.height="229px";
dialog.style.zIndex=2;
dialog.setAttribute("id","pinDialog");
dialog.innerHTML="<table height='80%' width='100%'>"+"<tr><td align='center'>The capital of Spain</td></tr></table>";
innerDiv.appendChild(dialog);
new OpacityObject('pinDialog','resource/images/dialog').setBackground();
}
</script>
</head>
<body onload="init()">
<p>
<h1>Ajaxian Maps</h1>
</p>
<div id="outerDiv">
<div id="toggleZoomDiv" onclick="toggleZoom()">
</div>
<div id="togglePushPinDiv" onclick="togglePushPin()">
</div>
<div id="innerDiv" style="z-index:0">
The rain in Spain falls mainly in the plains.
</div>
</div>
</body>
</html>
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月16日
2024年11月16日
- 秀兰玛雅.1999-友情人【大旗】【WAV+CUE】
- 小米.2020-我想在城市里当一个乡下人【滚石】【FLAC分轨】
- 齐豫.2003-THE.UNHEARD.OF.CHYI.3CD【苏活音乐】【WAV+CUE】
- 黄乙玲1986-讲什么山盟海誓[日本东芝版][WAV+CUE]
- 曾庆瑜1991-柔情陷阱[台湾派森东芝版][WAV+CUE]
- 陈建江《享受男声》DTS-ES6.1【WAV】
- 群星《闪光的夏天 第5期》[FLAC/分轨][392.38MB]
- 徐小凤《三洋母带》1:1母盘直刻[WAV+CUE][981M]
- 王菲1995《菲靡靡之音》[香港首版][WAV+CUE][1G]
- 《双城之战》主题小游戏现已上线 扮演金克丝探索秘密基地
- 《霍格沃茨之遗》PS5Pro画面对比:光追性能显著提升
- 《怪猎荒野》PS5Pro主机版对比:B测性能都不稳定
- 黄宝欣.1992-黄宝欣金装精选2CD【HOMERUN】【WAV+CUE】
- 群星.1996-宝丽金流行爆弹精丫宝丽金】【WAV+CUE】
- 杜德伟.2005-独领风骚新歌精选辑3CD【滚石】【WAV+CUE】