2016-11-19 45 views
0

在我的頁面中,我有一個橫幅div,下面是一個使用sticky-kit jquery插件粘貼的div。jquery sticky div gap

粘性的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> 
+0

您可以爲'div#header'製作'height:81px;'? – Banzay

+0

doh !!!是的,這是非常感謝你。 –

+0

我把它當作答案 – Banzay

回答

0

可以使高度:81px;對於div#頭文件