My HTML content is being generated from jquery and its depends on ajax response. In HTML content I have #leftsection
which has css "overflow-y:scroll;"
Inside "#leftsection"
I have boxes say "#devicebox_"+i
which has css "overflow-y:hidden;"
I'm appending dynamic list to "#devicebox_"+i
and if number of list content is > 6 I'm applying "#devicebox_"+i
my HTML content with left section and devicebox look something like this
<div id="leftsection">
<div id="devicebox_1">
<div id="listitem_1">LIST ITEM 1</div>
<div id="listitem_2">LIST ITEM 2</div>
<div id="listitem_3">LIST ITEM 3</div>
<div id="listitem_4">LIST ITEM 4</div>
<div id="listitem_5">LIST ITEM 5</div>
<div id="listitem_6">LIST ITEM 6</div>
<div id="listitem_7">LIST ITEM 7</div>
<div id="listitem_8">LIST ITEM 8</div>
</div>
</div>
Following is my jQuery to scroll down devicebox_1.
Remember there are multiple deviceboxes e.g devicebox_1,devicebox_2,devicebox_3 as a content is dynamic and so is listitem. after loading deviceboxes and their relative item list.
ajax request is being send one by one to process LIST ITEMS. what I'm trying to to is to scroll down current devicebox (devicebox_1) down to list item which is in process.
Following is small jQuery that I'm using to scroll down but not working
for( var i=0; i< $(itemlist).size(); i++)
{
$('#devicebox_'+currDeviceid).animate({
scrollTop: $('#listitem_'+i).offset().top
}, 100);
}