|
var lightbox = Class.create();
lightbox.prototype = { yPos : 0, xPos : 0, //构造方法,ctrl为创建该对象的元素 initialize: function(ctrl) { //将该元素的链接赋值给this.content this.content = ctrl.href; //为该元素添加onclick事件activate方法 Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false); ctrl.onclick = function(){return false;}; },
//当单击链接时 activate: function(){ if (browser == 'Internet Explorer'){//判断为IE浏览器 this.getScroll(); this.prepareIE('100%', 'hidden'); this.setScroll(0,0); this.hideSelects('hidden');//隐藏所有的<select>标记 } //调用该类中的displayLightbox方法 this.displayLightbox("block"); },
prepareIE: function(height, overflow){ bod = document.getElementsByTagName('body')[0]; bod.style.height = height; bod.style.overflow = overflow;
上一篇:如此高效通用的分页存储过程是带有sql注入漏洞的
下一篇:以绝招应对损招封杀木马病毒全攻略
|