javascript模拟ACDSEE简单功能

2016-01-29 11:35 10 1 收藏

javascript模拟ACDSEE简单功能,&#106avascript模拟ACDSEE简单功能

【 tulaoshi.com - Javascript 】

 

简单的放大缩小,显示坐标功能。
-------------------------------------
演示代码:
-------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<HTML
<HEAD
<TITLE Document </TITLE
<style type="text/css"
body{
 padding : 0px ;
 margin : 0px;
 background-color : #999999 ;
}
.DivMain {
 position : absolute ;
 text-align : center ;
 overflow : hidden ;
}
.DivMenu {
 position : absolute ;
 text-align : left ;
 overflow : hidden ;
}
.ImgMain {
 position : absolute ;
 overflow : hidden ;
 border : 0px ;
}
.TBMain {
 background-color : #CCCCCC ;
 padding : 0px ;
 border : 0px ;
 z-index : 99 ;
 line-height : 18px ;
 
}
.TBMenu {
 background-color : #FFCCCC ;
 padding : 0px ;
 border : 0px ;
 z-index : 99 ;
 color: #000000 ;
 
}
.HrScroll {
 margin : 0px;
 background-color : #FFFFFF ;
 padding : 0px ;
 border : 0px ;
 z-index : 99 ;
 color : #000000 ;
 border-spacing : 0px;
 width : 160px ;
 height : 10px ;
}
</style
<SCRIPT LANGUAGE="JavaScript"
<!--
 var originalWidth ;
 var originalHeight ;
 var objDivMain ;
 var objTbMain ;
 var objImg ;
 var ObjDrag ;
 var objDivMenu ;
 var objTbMemu ;
 var objbtnImgInfo ;
 var objDivFlag;
 var objHrScroll;
 var oRcts ;
 var oTextRange ; 
function setInit(obj) {
 objDivMain = document.getElementById("divMain") ;
 objTbMain =  document.getElementById("TbMain") ;
 objDivMenu = document.getElementById("DivMenu") ;
 objTbMenu =  document.getElementById("TbMenu") ;
 objImg = document.getElementById("imgMain") ;
 objbtnImgInfo = document.getElementById("btnImgInfo") ;
 
 objDivFlag = document.getElementById("DivFlag");
 objHrScroll = document.getElementById("HrScroll");
 originalWidth = obj.width;
 originalHeight = obj.height;
 objImg.style.width = originalWidth;
 objImg.style.height = originalHeight;
 fmImgZoom.FitScreen.click();
}
function setFitScreen() {
 initImg(objImg);
}
function setOriginal() {
 var intBodyWidth ;
 var intBodyHeight ;
 intBodyWidth = document.body.clientWidth ;
 intBodyHeight = document.body.clientHeight ;
 objImg.style.left = 0 ;
 objImg.style.top = 0 ;
 objImg.style.width = originalWidth;
 objImg.style.height = originalHeight;
 objImg.style.zoom = 1 ;
 objDivMain.style.width = intBodyWidth ;
 objDivMain.style.height = intBodyHeight - objTbMain.clientHeight;
 fnWritePos(objImg.style.left,objImg.style.top,objImg.style.zoom);
}
function initImg(objCurrent) {
 var intBodyWidth ;
 var intBodyHeight ;
 intBodyWidth = document.body.clientWidth ;
 intBodyHeight = document.body.clientHeight ;

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/javascript/)

 objTbMain.style.top = 0;
 objTbMain.style.height = 20;
 objTbMain.style.width = intBodyWidth;
 
 objDivMain.style.left = 0 ;
 objDivMain.style.height = intBodyHeight - objTbMain.clientHeight;
 objDivMain.style.width = intBodyWidth ;
 initZoom(objCurrent);
}
function initZoom(obj){
 var intObjWidth ;
 var intObjHeight ;
 var intDivHeight ;
 var intZoomRatio ;

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/javascript/)

 intDivHeight = objDivMain.style.pixelHeight;
 intObjHeight = obj.style.pixelHeight;
 intZoomRatio = intDivHeight / intObjHeight;
 obj.style.zoom = intZoomRatio ;
 obj.style.top = 0;
 obj.style.left = 0;
 fnWritePos (obj.style.left,obj.style.top,obj.style.zo

来源:https://www.tulaoshi.com/n/20160129/1482734.html

延伸阅读
  信息来源:《黑客防线》 本文一共介绍了七种方法: 一:最简单的加密解密 二:转义字符"\"的妙用 三:使用Microsoft出品的脚本编码器Script Encoder来进行编码 (自创简单解码) 四:任意添加NUL空字符(十六进制00H) (自创) 五:无用内容混乱以及换行空格TAB大法 六:自写解密函数法 七:错误的利用 (自创) 在做网页时(...
   [译者注:将本文的最后示例代码拷贝至文本文件中,更名文件为homepage.htm格式文件,在浏览器中运行,本文以该示例代码讲解   简介   ====================================   问题是我想解决自动访问http://www.thehungersite.com。这个页面能够限制你每一天只访问它一次(不要忘记在这链接上点击)。  ...
  使用Javascript数组 在JavaScript 1.0中构造器只存在Date对象和用户定义的对象。你可能期望有个数组构造器,但是一直没能实现,直到JavaScript 1.1的出现,你的期望成为了现实。我们可以如下来定义用户对象: function blankArray(n) { for (var i=0; i < n; i++) this[i] = null; this.length = n; } blankArray函数创建了一...
标签: ASP
  使用javascript创建Microsoft XML DOM,就可以完成这一工作. // 装入数据. var source = new ActiveXObject("Microsoft.XMLDOM"); source.async = false source.load("history.xml"); // 装入样式表. var stylesheet = new ActiveXObject("Microsoft.XMLDOM"); stylesheet.async = false ...
标签: ASP
  ASP具备管理不同语言脚本程序的能力,能够自动调用合适的脚本引擎以解释脚本代码和执行内置函数。ASP开发环境提供了两种脚本引擎,即VBScript(缺省)和JScript。不过,开发者并没有被限制于只能使用这两种语言,只要能够提供合适的ActiveX脚本引擎就能使用任何脚本语言。 脚本语言的选择往往基于许多不同原因:它可能是开发者最...

经验教程

532

收藏

33
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部