Tag: iscroll

当第二页应该可滚动时,iScroll 5不工作

我正在使用apache cordova 2.2 jquery 1.7.2 jquery mobile 1.4.3 iscroll 5 (Matteo Spinelli ~ http://cubiq.org/) 我有以下index.html: some buttons some buttons 我显示可滚动页面id =“thisshouldscroll”如下: $.mobile.changePage( “#thisshouldscroll”, { transition: “slideup”} ); buildScrollingData(); myScroll = new IScroll(‘#wrapper’, { mouseWheel: true, scrollbars: true }); 在其他地方,我已经定义: function displayScrollingData(){ var contentToAppend=””; //loop web service data add certain data to contentToAppend with contentToAppend = […]

如何创建无限的iscroll?

我在我的网页上创建了iScroll,它运行得很好。 但现在我想让它作为无限的iscroll工作,但我不知道该怎么做。 我的iscroll代码是: myCarousel_up = new iScroll(‘scroller_upCarousel’, { snap: true, momentum: false, hScrollbar: false, vScrollbar: false, desktopCompatibility:true, onScrollEnd: function () { } }); 谁能帮我?

当我使用ajax渲染Scroller部分时,iScroll不起作用

我遇到了一个奇怪的问题。 如果我使用“for loop”将html渲染为滚动部分,一切都运行良好。 但是当我使用ajax将我的数据渲染成滚动部分时.iScroll不起作用(无法滚动)。 这是我的url:http: //yuanwang.sinaapp.com/8505/item.html 您可以复制我的代码并尝试自己。 打开item.js并尝试运行“for循环”,你可以看到一切运行良好。

同一页面上有多个iScroll元素

我正在制作一个带有jQtouch和iScroll的移动网站。 我不想用iScroll获得多个可滚动区域,但只有列表适用于iScroll … 我试过这个: var scroll1, scroll2; function loaded() { scroll1 = new iScroll(‘wrapper’); scroll2 = new iScroll(‘list_wrapper’); } 但没有运气。 任何人都有一个有效的解决方案? 我的HTML: Test Test

提高大型桌面上的iScroll性能

我正在根据用户如何滚动以保持它们对齐来以编程方式更新表头及其第一列位置。 我遇到的问题是,只要我的数据集足够大,滚动就会越来越不稳定/不太平滑。 相关代码位于小提琴的最底层: iScroll.on(‘scroll’, function(){ var pos = $(‘#scroller’).position(); $(‘#pos’).text(‘pos.left=’ + pos.left + ‘ pos.top=’ + pos.top); // code to hold first row and first column $(‘#scroller th:nth-child(1)’).css({top: (-pos.top), left: (-pos.left), position:’relative’}); $(‘#scroller th:nth-child(n+1)’).css({top: (-pos.top), position:’relative’}); // this seems to be the most expensive operation: $(‘#scroller td:nth-child(1)’).css({left: (-pos.left), position:’relative’}); }); 我知道通过缓存元素等可以写得更有效。 例如,我尝试将元素保存到数组中,并以更“香草”的方式更新它们的位置: headerElements[i].style.left = left […]

Jquery Mobile返回按钮滚动到顶部

在我的Jquery Mobile网站上,我使用href作为后退按钮; 但如果我在第一页上滚动,后退按钮会再次跳回到顶部。 第一页不会保持相同的位置。 这有什么解决方案吗?