爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
图片放大镜特效
图片放大镜特效
日期:2014-05-18 浏览次数:20229 次
以下是程序代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网" /> <meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>图片放大镜特效,sky整理收集,站长特效网欢迎您。</title> <SCRIPT> var shrinkfactor=5 // left and top position of the thumbnailimage // (distance to the left and top browser-margin, pixels) var thumbleft = 30 var thumbtop = 30 // left and top position of the zoomed image // (distance to the left and top browser-margin, pixels) var largeleft = 300 var largetop = 30 // width and height of the enlarged image's sector (visible part, pixels) var clipwidth = 240 var clipheight = 160 </SCRIPT> <SCRIPT> var isNav, isIE var offsetX, offsetY var selectedObj //欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 var largewidth = 0 var largeheight = 0 var thumbwidth = Math.floor(largewidth/shrinkfactor) var thumbheight = Math.floor(largeheight/shrinkfactor) var dragimgwidth = Math.floor(clipwidth/shrinkfactor) var dragimgheight = Math.floor(clipheight/shrinkfactor) var dragimgleft = thumbleft+3 var dragimgtop = thumbtop+3 var difleft= largeleft-thumbleft var diftop= largetop-thumbtop var clippoints var cliptop=0 var clipbottom=cliptop+clipheight var clipleft=0 var clipright=clipleft+clipwidth if (parseInt(navigator.appVersion) >= 4) { if (navigator.appName == "Netscape") { isNav = true } else { isIE = true } } function setZIndex(obj, zOrder) { obj.zIndex = zOrder } function shiftTo(obj, x, y) { if (isNav) { if(x<=document.thumb.left) {x=document.thumb.left} if(x>=(document.thumb.left+thumbwidth-dragimgwidth-2)) {x=document.thumb.left+thumbwidth-dragimgwidth-2} if(y<=document.thumb.top) {y=document.thumb.top} if(y>=(document.thumb.top+thumbheight-dragimgheight-2)) {y=document.thumb.top+thumbheight-dragimgheight-2} obj.moveTo(x,y) } else { if(x<=document.all.thumb.style.posLeft) {x=document.all.thumb.style.posLeft} if(x>=(document.all.thumb.style.posLeft+thumbwidth-dragimgwidth-2)) {x=document.all.thumb.style.posLeft+thumbwidth-dragimgwidth-2} if(y<=document.all.thumb.style.posTop) {y=document.all.thumb.style.posTop} if(y>=(document.all.thumb.style.posTop+thumbheight-dragimgheight-2)) {y=document.all.thumb.style.posTop+thumbheight-dragimgheight-2} obj.pixelLeft = x obj.pixelTop = y } cliptop = (y-thumbtop)*shrinkfactor clipbottom = cliptop+clipheight clipleft = (x-thumbleft)*shrinkfactor clipright = clipleft+clipwidth if (document.all) { clippoints ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" document.all.large.style.posTop=largetop-cliptop document.all.large.style.posLeft=largeleft-clipleft document.all.large.style.clip=clippoints } if (document.layers) { document.large.top=largetop-cliptop document.large.left=largeleft-clipleft document.large.clip.left = clipleft document.large.clip.right = clipright document.large.clip.top = cliptop document.large.clip.bottom = clipbottom } }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 function setSelectedElem(evt) { if (isNav) { var testObj var clickX = evt.pageX var clickY = evt.pageY for (var i = document.layers.length - 1; i >= 0; i--) { testObj = document.layers[i] if ((clickX > testObj.left) && (clickX < testObj.left + testObj.clip.width) && (clickY > testObj.top) && (clickY < testObj.top + testObj.clip.height && document.layers[i].id=="dragimg")) { selectedObj = testObj setZIndex(selectedObj, 100) return } } } else { var imgO
上一篇:狡猾的按钮特效
下一篇:判断远程图片是否存在
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
亚马逊Fire Phone:请别拿我跟苹果三星比
安全服务机构:公布2014年度最糟糕的25个密码
二代 iPad Air将配备2GB内存?为同屏多任务做准备
支付宝全面封杀比特币:充值码淘宝店或遭封禁
亚马逊宣布新春大促策略 欲打造另一个"黑五"
英特尔涉嫌垄断 欧盟或开出史上最高罚单
马斯克的特斯拉能否保持好势头
传搜狗估值12亿美元 与360谈判进入白热化
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
推荐阅读
更多>
微博启动自媒体计划 粉丝+收入双激励是亮点
《中国三网融合业务运营管理》研讨报告征订函
团购网站存活率仅18.6% 剩余缺乏千家
HTC与苹果三星距离扩展 C2B形式成新武器
郭美美事件推手被抓 “秦火火”拷问网络底线
腾讯微信昨晚再现大规模故障 多地受到影响
PC迎9年来出货量新低 平板电脑渐成主流
HTC曝出特大丑闻:高管诈骗+商业间谍
虚拟运营市场躁动:山西煤老板兴味浓重
微软不会被颠覆
柳传志马云陷舆论漩涡:请不要辜负这个时代
iPhone 6将于10月17日内地上市:售5288元起
余额宝收益率跌破5% 银行系宝宝收益率赶超
安全服务机构:公布2014年度最糟糕的25个密码
央行暂停二维码支付及虚拟信用卡 支付宝微信不知情
9月1日起免征新能源汽车购置税
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
薛蛮子取保后首次发微博表示:辜负你们了
全球五大电信设备商业绩:华为净利居首
传诺基亚5月14日发布会推出Lumia 950