首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

capture 与 unCapture 擒获在IE外的浏览器实现

2012-11-09 
capture 与 unCapture 捕获在IE外的浏览器实现function syncScroll(){Hc.isCapture && overlayElement.set

capture 与 unCapture 捕获在IE外的浏览器实现

function syncScroll(){Hc.isCapture && overlayElement.setLocation(Hc.getScroll());}capture:Hc.isIE?function(target){if(Hc.captureTarget){Hc.unCapture();}(Hc.captureTarget = Hc.getDom(target)).setCapture();Hc.isCapture = true;}:function(target/*,handle*/){Hc.isCapture = true;if(!overlayElement){overlayElement = Hc.getBody().on("scroll",syncScroll).createIn({cls:"hc-capture-overlay"},true);}/*2010-07-15 取消第2个参数handle = handle || target;if((handle = handle || target)!=cacheHandle){cacheHandle = handle;overlayElement.setStyle("cursor",Hc.fly(cacheHandle,"_capture").getStyle("cursor"));}*/if(target != cacheTarget){cacheTarget = target;cacheFly = Hc.fly(cacheTarget,"_capture");overlayElement.setStyle("cursor",cacheFly.getStyle("cursor"));}overlayElement.show();syncScroll();Hc.captureTarget = cacheFly.dom;},/***@getter 鼠标捕获的目标.*/captureTarget:null,/***@getter 是否鼠标被捕获.*/isCapture:false,/***解除捕获鼠标.*/unCapture:function(){if(Hc.captureTarget){Hc.isIE ? Hc.captureTarget.releaseCapture():overlayElement.hide();Hc.captureTarget = null;Hc.isCapture = false;}},

?

热点排行