智能手环 安桌源码,vscode文字设置,ubuntu安装系统如何分区,tomcat 415报错,sqlite单表容量,jquery模糊查询插件,前端页面自动生成框架,github开源爬虫项目,php子类 父类,常州seo技术,小说网站用了杰奇网络,公安局网页交流模板,帝国cms 7.2企业模板,html5的在线播放页面,办公管理系统源代码下载,防伪系统开源程序lzw
jquery问卷调查源码,vscode编译c 乱码,安装Ubuntu为/,tomcat响应被拦截,sqlite数据库的方法,网络爬虫哪本书比较好听,php文件内容搜索,成都做外贸seo服务,书画展示网站源码,移动端的网站模板下载工具lzw
function $(pId){ return document.getElementById(pId); }
function JPos(){
}
JPos.getAbsPos = function(pTarget){ var _x = 0; var _y = 0; while(pTarget.offsetParent){ _x += pTarget.offsetLeft; _y += pTarget.offsetTop; pTarget = pTarget.offsetParent; } _x += pTarget.offsetLeft; _y += pTarget.offsetTop;
return {x:_x,y:_y}; }
function JAniObj(){ this.obj = null; this.interval = null;
this.orgPos = null; this.targetPos = null;
this.orgSize = {w:50,y:50}; //初始长宽 this.targetSize = {w:100,y:100}; //目标长宽 this.step = {x:10,y:10}; //步长 x:x方向 y:y方向 this.alpha = {s:10,e:90,t:10}; //透明度,s初始,e结束,t步长 }
function JAni(){ var self = this; var aniObjs = {};
this.popup = function(pDiv,pOrgSize,pTargetSize,pStep,pAlpha){
var aniObj = new JAniObj(); aniObjs[pDiv] = aniObj;
with(aniObj){ obj = $(pDiv); orgPos = JPos.getAbsPos(obj); orgSize = pOrgSize; targetSize = pTargetSize; step = pStep; alpha = pAlpha;
with(obj.style){ overflow = “hidden”; position = “absolute”; width = pOrgSize.w + “px”; height = pOrgSize.h + “px”; left = orgPos.x + “px”; top = orgPos.y + “px”; if(document.all){ filter = “Alpha(opacity=” + pAlpha.s + “)”; }else opacity = pAlpha.s / 100; } }
aniObj.interval = setInterval(“popup_(‘” + pDiv + “‘)”,10); }
popup_ = function(pDivId){
pObj = aniObjs[pDivId];
var w = parseInt(pObj.obj.style.width); var h = parseInt(pObj.obj.style.height);
if(w >= pObj.targetSize.w && h >= pObj.targetSize.h){ clearInterval(pObj.interval); if(document.all) pObj.obj.style.filter = “Alpha(opacity=” + pObj.alpha.e + “)”; else pObj.obj.style.opacity = pObj.alpha.e / 100; delete aniObjs[pObj.obj.id]; }else{ if(w < pObj.targetSize.w) w += pObj.step.x; if(h <pObj.targetSize.h) h += pObj.step.y; if(document.all){ var pattern = /opacity=(\d{1,3})/; var result = pattern.exec(pObj.obj.style.filter); if(result != null){ if(result[1] < pObj.alpha.e) pObj.obj.style.filter = "Alpha(opacity=" + (result[1] + pObj.alpha.t) + ")" else pObj.obj.style.filter = "Alpha(opacity=" + pObj.alpha.e + ")"; } }else{ if(pObj.obj.style.opacity < pObj.alpha.e / 100){ pObj.obj.style.opacity = parseFloat(pObj.obj.style.opacity) + pObj.alpha.t / 100; }else pObj.obj.style.opacity = pObj.alpha.e / 100; } } pObj.obj.style.width = w + "px"; pObj.obj.style.height = h + "px"; } } var ani = new JAni(); ani.popup( "apDiv1", {w:50,h:50}, //初始长宽 {w:200,h:500}, //目标长宽 {x:8,y:8}, //步长 {s:10,e:80,t:10}//透明度 起始,结束,步长 ); ani.popup( "apDiv2", {w:30,h:50}, //初始长宽 {w:400,h:400}, //目标长宽 {x:8,y:8}, //步长 {s:10,e:80,t:2}//透明度 起始,结束,步长 ); ani.popup( "apDiv3", {w:10,h:10}, //初始长宽 {w:200,h:500}, //目标长宽 {x:8,y:8}, //步长 {s:10,e:80,t:10}//透明度 起始,结束,步长 );
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]