Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

making iscroll to work when loading a div dynamically

can anyone please explain, with an example if possible, how to load dynamic content inside an iscroll div and assign a new height to it?

I can get it to work but I can't control the height of the scroll for the new content.

I'm new to all this and have no clue were to start.

here's what I'm working on:

http://homepage.mac.com/jjco/test/index7.html

when the page is loaded you see the scroll bar where there's no content... clicking on print/damm (shows the height I originally set for this content) clicking on print/fcbarcelona (maintains the same height and position of the scroll you used before) as you see it's not working as it should. obviously, I don't want the scroll to be there when it's not necessary.

any help would be greatly appreciated.

like image 547
user994531 Avatar asked Oct 15 '11 10:10

user994531


1 Answers

It's better to use the refresh() method in iScroll, which will recalculate the height.

myScroll.refresh();
like image 182
Martin Carlsson Avatar answered Sep 20 '22 07:09

Martin Carlsson