jquery粘性div间隙

时间:2016-11-19 20:36:07

标签: jquery html sticky

在我的页面中,我有一个横幅div,下面是一个使用sticky-kit jquery插件粘贴的div。

粘性div应该很难对付横幅div,但不知何故,1个像素正在爬行,这意味着当你滚动文本时,你会得到相当令人反感的效果。

我已经在这里做了jsfiddle,非常感谢任何建议。我已经为jquery尝试了其他粘性插件,他们似乎都有同样的问题。

Live jsFiddle example here

HTML:

<div id="header">
    <h2>Main Banner</h2>
</div>
<div id="wrapper">
    <div id="left">
        <h2>Menu</h2>
    </div>
    <div id="right">
        <table id="tableHeader" width="100%" class="myTable" cellspacing="0">
            <tr>
                <td bgcolor="#FFFFCC"><h2>Inner Banner</h2><br>aaa</td>
            </tr>
        </table>
        <br>
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
        standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
        type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
        remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
        Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of
        Lorem Ipsum.
        <br>
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
        standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
        type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
        remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
        Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of
        Lorem Ipsum.
        <br><br>
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
        standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
        type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
        remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
        Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of
        Lorem Ipsum.
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

你可以做到身高:81px;为div#header