//绑定事件:
dojo.connect(unieap.byId("GROUP_TYPE"), "onMouseOver", this, over);
dojo.connect(unieap.byId("GROUP_TYPE"), "onMouseOut", this, out);
//onmouseover 事件触发的函数
function over(e, message){
cen.innerText = "双跨团组:与校外或北京以外地区单位共同出访的团组";
var ttop = e.offsetTop; //这里得到指定控件离父容器控件顶部的距离 px
var tleft= e.offsetLeft; //这里得到指定控件离父容器控件左边的距离 px
var h = e.clientHeight; //这里得到指定控件的高度
var w = e.clientWidth; //这里得到指定控件的宽度
var originalE = e;
//这里通过 e = e.offsetParent 操作,一直将e变成document对象,既最高级别的容器;
//这里ttop 和 tleft 就得到了指定控件距离网页 顶部 和 左部 的距离;
while (e = e.offsetParent){
ttop += e.offsetTop; tleft += e.offsetLeft;
}
cen.style.display = ""; //层显示
cen.style.top = ttop + h;
cen.style.left= tleft + w - cen.clientWidth; //上面的代码都是将悬浮层调整到指定控件的正下方
}
//onmouseout 事件触发的函数
function out(){
cen.style.display = "none";
}
dojo.connect(unieap.byId("GROUP_TYPE"), "onMouseOver", this, over);
dojo.connect(unieap.byId("GROUP_TYPE"), "onMouseOut", this, out);
//onmouseover 事件触发的函数
function over(e, message){
cen.innerText = "双跨团组:与校外或北京以外地区单位共同出访的团组";
var ttop = e.offsetTop; //这里得到指定控件离父容器控件顶部的距离 px
var tleft= e.offsetLeft; //这里得到指定控件离父容器控件左边的距离 px
var h = e.clientHeight; //这里得到指定控件的高度
var w = e.clientWidth; //这里得到指定控件的宽度
var originalE = e;
//这里通过 e = e.offsetParent 操作,一直将e变成document对象,既最高级别的容器;
//这里ttop 和 tleft 就得到了指定控件距离网页 顶部 和 左部 的距离;
while (e = e.offsetParent){
ttop += e.offsetTop; tleft += e.offsetLeft;
}
cen.style.display = ""; //层显示
cen.style.top = ttop + h;
cen.style.left= tleft + w - cen.clientWidth; //上面的代码都是将悬浮层调整到指定控件的正下方
}
//onmouseout 事件触发的函数
function out(){
cen.style.display = "none";
}