Hallo,
ich wollte es so machen , dass ich beim Runterscrollen, wenn es am Ende angekommen ist, er 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:
HTML Code:
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
...
}
});
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:
HTML Code:
<section class="result_reactions_data_users">
<div class="item">
<p>Hier steht etwas drinne.</p>
</div>
...
...
</section>
CSS:
Code:
.result_reactions_data_users {
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;
}
JS:
HTML Code:
$('.result_reactions_data_users').scroll(function() {
if($('.result_reactions_data_users').scrollTop() == $('.result_reactions_data_users').height() - $('.result_reactions_data_users').height()) {
alert('ausgabe');
}
});