又一个漂亮的导航栏的下拉菜单 时间:2020-05-12 人气:0 网上收集整合出来的,算是剽窃吧,IE6下用过,其他的没试。 SHARE <script language="javascript"> function TFly_Init(name, offsetLeft, offsetTop, alignment, anyIter, anyTime, staticHover, popupHover, popupLatency, hideLatency, onInit, onPopup, onHide) { var TFly = document.getElementById(name); TFly.DT = document.getElementById(name + "_Popup"); TFly.F = document.getElementById(name + "_Anim"); TFly.oX = offsetLeft; TFly.oY = offsetTop; TFly.alignment = alignment; TFly.AnyIter = anyIter; TFly.AnyTime = anyTime; TFly.popupLatency = popupLatency; TFly.hideLatency = hideLatency; TFly.onPopup = onPopup; TFly.onHide = onHide; TFly.onmouseover = function() { if (staticHover != '') { TFly.className_ = TFly.className; TFly.className = staticHover; } TFly_Popup(TFly, true); } TFly.onmouseout = function() { if (staticHover != '') { TFly.className = TFly.className_; } TFly_Popup(TFly, false); } if (document.all) { TFly.onactivate = TFly.onmouseover; TFly.ondeactivate = TFly.onmouseout; } else { TFly.onfocus = TFly.onmouseover; TFly.onblur = TFly.onmouseout; } TFly.DT.onmouseover = function() { if (popupHover != '') { TFly.DT.className_ = TFly.DT.className; TFly.DT.className = popupHover; } TFly_Popup(TFly, true); } TFly.DT.onmouseout = function() { if (popupHover != '') { TFly.DT.className = TFly.DT.className_; } TFly_Popup(TFly, false); } TFly_CallClientFunction(onInit, TFly); } function TFly_CallClientFunction(name, TFly) { if (name != null && name != "") eval(name + "(TFly);"); } function TFly_SetPosition(TFly, obj) { obj.style.top = TFly.oY + TFly.offsetHeight + "px"; obj.style.left = TFly.oX + (TFly.offsetWidth - obj.offsetWidth ) * (1 + TFly.alignment) / 2 + "px"; } function TFly_Popup(TFly, value) { if (TFly.timer != null) window.clearTimeout(TFly.timer); if (value) { if (TFly.status == "on") return; var timeout = (TFly.status == "active") ? 0 : TFly.popupLatency; if (TFly.AnyIter > 0 && TFly.AnyTime > 0) TFly.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, true, TFly.F.curIter);}, timeout); else TFly.timer = window.setTimeout(function() {TFly_SetVisibility(TFly, true);}, timeout); } else { if (TFly.status == "off") return; var timeout = (TFly.status == "active") ? 0 : TFly.hideLatency; if (TFly.AnyIter > 0 && TFly.AnyTime > 0) TFly.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, false, TFly.F.curIter);}, timeout); else TFly.timer = window.setTimeout(function() {TFly_SetVisibility(TFly, false);}, timeout); } } function TFly_SetVisibility(TFly, value) { if (value == true) { TFly_SetPosition(TFly, TFly.DT); TFly.DT.style.visibility = "visible"; TFly.style.zIndex = "999"; } else { TFly.DT.style.visibility = "hidden"; TFly.style.zIndex = "0"; TFly.DT.style.left = "-10000px"; } } function TFly_AnimateStart (TFly, inout, curIter) { if (TFly.F.timer != null) window.clearTimeout(TFly.F.timer); if (curIter == null) curIter=0; if (TFly.status != "active") { TFly.status = "active"; TFly.F.style.visibility = "visible"; TFly.DT.style.visibility = "hidden"; } if (curIter < 0 || curIter > TFly.AnyIter) { TFly.F.curIter = (curIter < 1) ? 0 : TFly.AnyIter; TFly.status = (TFly.F.curIter == TFly.AnyIter) ? "on": "off"; TFly.F.style.visibility = "hidden"; TFly_SetPosition(TFly, TFly.DT); TFly.style.zIndex = (TFly.F.curIter == TFly.AnyIter) ? "999" : "0"; if (TFly.F.curIter == TFly.AnyIter) { TFly.status = "on"; TFly_SetVisibility(TFly, true); TFly_CallClientFunction(TFly.onPopup, TFly); } else { TFly.status = "off"; TFly_SetVisibility(TFly, false); TFly_CallClientFunction(TFly.onHide, TFly); } } else { var per = curIter * (95 / TFly.AnyIter) + 5; TFly.F.style.visibility = "hidden"; TFly.F.style.width = TFly.DT.offsetWidth / 100 * per + "px"; TFly.F.style.height = TFly.DT.offsetHeight / 100 * per + "px"; TFly_SetPosition(TFly, TFly.F); TFly.F.style.visibility = "visible"; var timeout = (per == 100 ) ? 0 : TFly.AnyTime - (TFly.AnyTime / (TFly.AnyIter) * (curIter)); curIter += (inout) ? 1 : -1; TFly.F.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, inout, curIter)}, timeout); TFly.F.curIter = curIter; } } </script> 2007年06月14日 星期四 4月份年休假人员名单公布 请大家尽快上交4月份交通燃油发票。 4月25日文艺晚会推迟至4月29日,请互相转告! 查看全部 | 我的账户 shundyang 注销登录 | 切换用户 修改密码 | 锁定界面 我的文档 | 基本资料 | 发布 | 论坛 | 管理 | 链接 培训信息 | 企务直通车 | 党务公开专栏 文化人物 | 网上论坛 | 企业快讯 招聘信息 | 共青团 | 招投标工程 投诉与意见 | 联系我们 | 广告推广 网站地图 | 帮助 | <script> TFly_Init('MS_user', 0, 0, -1, 2, 60, 'MSFlyoutStaticHover_msdn', '', 100, 400, '', '', ''); TFly_Init('MS_shortcut', 0, 0, 1, 2, 60, 'MSFlyoutStaticHover_msdn', '', 100, 400, '', '', ''); </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容