Hallo,
ich wollte es so machen , dass ich beim Runterscrollen (ganz am ende) etwas ausgibt.
Der macht das aber nur wenn ich erst nach unten dann wieder nach oben scrolle. Ich wollte aber, dass er immer am ende etwas ausgibt. Woran liegt das?
Normal funktioniert es ja so:
JavaScript
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
// ajax call get data from server and append to the div
}
});
Da ich aber eine Modal Box habe und die height auf 500px ist und overflow-y müsste ich es irgendwas anders machen oder warum funktioniert es nicht?
HTML
Spoiler anzeigen
CSS:
Spoiler anzeigen
CSS
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-webkit-box-pack: center;
-moz-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-content: stretch;
-ms-flex-line-pack: stretch;
align-content: stretch;
-webkit-box-align: center;
-moz-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin: 0 auto;
text-align: center;
overflow-y: scroll;
height: 500px;
padding: 8px;
Alles anzeigen
JS