Ich möchte unendlich scrollen implementieren. Unten ist eine kurze Form meines Layouts. Da ich einige Elemente relativ positioniert habe, wird das JavaScript-Scroll-Ereignis nicht ausgelöst.Wie scrollevent erfassen?
Wie kann ich dieses Problem beheben, um das Scroll-Ereignis ausgelöst zu bekommen und das unendliche Scrollen zu implementieren?
Mein Haupt Layout ist:
<div id="container">
<div class="wrapper">
<div id="header">
...
</div> <%-- header --%>
<div id="main">
...
</div>
</div> <%-- wrapper --%>
</div> <%-- container --%>
<div id="footer">
</div>
Und mein CSS ist:
#container {
position: absolute;
z-index: 1;
top: 0;
bottom: 35px;
left: 0;
right: 0;
overflow-y: auto;
overflow-x: hidden;
}
.wrapper {
margin: 0 auto;
width: 960px;
position: relative;
}
#header {
position: relative;
}
#main {
}
#footer {
z-index: 2;
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 35px;
}
Was muss ich so ändern, dass ich den Browser Scroll-Ereignis mit meinem Layout empfangen kann unendliche Scrollen zu implementieren ?
Hope this Hilfe http://stackoverflow.com/questions/2710568/css-achieving-two-way-infinite-scroll-with-mouse-drag –