Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
109
rated 0 times [  116] [ 7]  / answers: 1 / hits: 26534  / 10 Years ago, tue, october 7, 2014, 12:00:00
<div class=row>
<div class=col-md-8 id=homeview-story></div>
<div class=col-md-4 id=homeview-stream>
<div id=log></div>
</div>
</div>


#homeview-story {
overflow: scroll;
width: 72%;
height: 800px;
}
#homeview-stream {
overflow: scroll;
width: 28%;
height: 800px;
}


$(document).ready(function() {
$('#homeview-story').scroll(function() {
$(#log).append(<div>Handler for .scroll() called.</div>);
});
});


Objective is to implement infinite scrolling for both homeview-story and homeview-stream separately to load respective data. The scroll function works on the window obj ($(window).scroll) but is not working with specific div.


More From » jquery

 Answers
3

The issue is that, #homeview-story isn't overflowing, So it isn't scrolling. First of all it should have some content larger than that for it to scroll, which is missing in your code.



Here's a Demo, where #logo has a height greater than it's parent #homeview-stream and we're listening to it's scroll.


[#69215] Saturday, October 4, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
andreguym

Total Points: 125
Total Questions: 112
Total Answers: 103

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
;