使iscroll在动态加载div时工作 [英] making iscroll to work when loading a div dynamically
问题描述
我可以得到它工作,但我无法控制新内容的滚动的高度。
我是新来的,没有任何线索开始。 p>
这是我正在做的工作:
http://homepage.mac.com/jjco/test/index7.html
当页面为加载你看到没有内容的滚动条...
点击打印/ damm(显示我最初为此内容设置的高度)
点击打印/ fcbarcelona(保持相同的高度和位置你以前使用的滚动),因为你看到它不工作,因为它应该。
显然,我不想滚动到那里,当没有必要。
任何帮助将不胜感激。
在iScroll中使用refresh()方法,它将重新计算高度。
myScroll.refresh();
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.
It's better to use the refresh() method in iScroll, which will recalculate the height.
myScroll.refresh();
这篇关于使iscroll在动态加载div时工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!