日期:2014-05-16  浏览次数:20497 次

jquery的导航页面七(nodeDocPage.jsp续)
    // 鼠标移至导航条时的弹出隐藏下拉菜单
    function toolBarHover(span) {
    // 该数组存放各select控件原始的visibility属性值
   
        var originalStatus = new Array();
    var pop = $("#popup");
        $(span).hover(function(){
    span.attr("className", "tool_bar_onmouseover");

        var spanOffset = $(this).offset();
    pop.attr("className", "popup_mouseover");
    pop.css("left", spanOffset.left - $("#c_shadow").offset().left);
    pop.css("top", spanOffset.top - $("#c_shadow").offset().top + $(this).height());
   
        pop.empty();
       
        var level = parseInt(span.attr("level"));
        var classmates = navigation_bar_classmates[level];
       
        for (var i=0; i < classmates.length; i++) {
       
        var item = $("<span></span>");
       
    item.attr("id", classmates[i].item_id);
    item.attr("level", classmates[i].level);
    item.text(classmates[i].item_name);
    item.bind("click", function(){
        addNavigationItem($(this).clone());
        pop.hide();
        return false;
    });
       
        item.attr("className", "popup_mouseover");
   
item.hover(menuItemOnMouseOver, menuItemOnMouseOut);
        pop.append(item);
        }
       
//设置该对象的事件
pop.hover(divPopupOnMouseOver, divPopupOnMouseOut);

if (getOs() == "MSIE") {
        var frm = $("<iframe id='iframePopup' scrolling='no' frameborder='0' style='position:absolute;visibility:inherit; top:0px; left:0px;'></iframe>");
        frm.width(pop.width());
        frm.height(pop.height());
        frm.css("zIndex", pop.css("zIndex") - 1);
        pop.append(frm);
}

        pop.show("fast");
        }, function(e) {
            $(span).attr("className", "normal");
            var left = $(span).offset().left;
            var top = $(span).offset().top;
            var height = $(span).height();
           
            //获得鼠标位置
var x, y;
e = e || window.event;
if(e.pageX || e.pageY){
x=e.pageX;
y=e.pageY;
}else{
x=document.body.scrollLeft+event.clientX;
y=docume