You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.9 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//e :要鼠标滑对象me弹出相对对象位置;BPx :向下偏移量;DTime效果显示时间
//更新 --ycc 2010-01-08
///e :要鼠标滑对象me弹出相对对象位置;BPx :向下偏移量;DTime效果显示时间
///e :要鼠标滑对象me弹出相对对象位置;BPx :向下偏移量;DTime效果显示时间
function OverShowMenu(e,me,BPx,LPx,DTime)
{
if(typeof e != "string") return;
if(typeof me != "string") return;
if(typeof BPx != "number") BPx = 10;
if(typeof LPx != "number") LPx = 10;
if(typeof DTime != "number") DTime = 0;
if(typeof $=="function")
{
$(function(){
function _Over(e,me)
{
var ele = $("#"+e),eofs = ele.offset(),ePx = -( ele.innerHeight()+BPx) ,she,TimeOutSpan;
ele.hover(function(){
if(!document.getElementById(me+"keep"))
{
$("body").prepend("<div class='alltourList' style='z-index:1000002;position:absolute;top:"+(eofs.top-ePx)+"px;left:"+(eofs.left -LPx)+"px;' id='"+me+"keep'>"+ $("#"+me).html()+"</div>");
she = $("#"+me+"keep") ;
she.hover(function(){if(TimeOutSpan)clearTimeout(TimeOutSpan);},function(){TimeOutSpan = setTimeout(she.hide(DTime),600);});
}
if(TimeOutSpan)clearTimeout(TimeOutSpan);
she.show();
},function(){
TimeOutSpan = setTimeout(function(){she.hide(DTime)},600);
});
}
_Over(e,me);
});
}
}
//OverShowMenu("textMenu","textBox",0,0,700);
//OverShowMenu("textMenu2","textBox2",0,0,700);
/*
调用例子
OverShowMenu("NAV_ChinaTravelGuide","BOX_ChinaTravelGuide",-305);
<a href="/travelguide/" class="moreCatagory" id="NAV_ChinaTravelGuide" >China Travel Guide</a>
<div class="alltourList" id="BOX_ChinaTravelGuide" style="display: none">
<ul>
<li><a href="#">xxxxxx</a></li>
<li><a href="#">xxxxxx</a></li>
</ul>
<div class="clear"></div>
</div>
*/