代码之家  ›  专栏  ›  技术社区  ›  psoares

css弹出窗口在表的最后一行不起作用

  •  2
  • psoares  · 技术社区  · 14 年前

    大家好!

    question .

    弹出窗口始终位于单元格的底部。但是滚动条隐藏了最后一个。
    所以我希望弹出窗口保持在滚动条上方。

    我试着放

    z-index: 999; #popup hover 
    z-index: 1; #scrollbar
    

    但那不管用。

    如果需要任何代码,请直接询问。

    谢谢大家!

    2 回复  |  直到 7 年前
        1
  •  1
  •   zod    14 年前

    使用firefox firebug并使用

     css  top:100px,left:100px. 
    

    其实我也有类似的问题。 我在第一个表下面放置了一个高度为popup的空表(单击此表列时显示popup)。

    <table><tr><td>on click or mouse over show popup</td></tr>
    <tr><td>on click or mouse over show popup</td></tr>
    <tr><td>on click or mouse over show popup</td></tr>
    <tr><td>as this the last td popup was going inside the scroll so i put table below</td></tr></table>
    
    <table><tr><td height='50px'> </td></tr></table>
    

    如果这不是你的情况。对不起。:)

        2
  •  1
  •   psoares    13 年前

    在模板的底部:

     <div id="popup-flyer"></div>
    

    function make_tooltip () {
       var tooltip = $(this);
       var flyer = $("#popup-flyer");
       flyer.css('position', 'absolute');
       flyer.css('left', tooltip.position().left + 30);
       flyer.css('top', tooltip.position().top);
       flyer.append(tooltip.children('span').clone());
       flyer.show(1);
    };
    
    function hide_tooltip () {
       var tooltip = $(this);
       var flyer = $("#popup-flyer");
       flyer.hide(1);
       flyer.children('span').remove();
    };
    
    $(document).ready( function () {
    $(".tooltip").hover(make_tooltip, hide_tooltip);
    });
    

    css:

    a class='tooltip'>
                    <img src="image" alt="" height="20" width="20" />
                        <span> lalalakalsjsjhfksajhfdsh
                               text here....
                        </span>
                </a>