Tag: 平滑滚动

android:smoothScrollToPosition()不能正常工作

我试图平滑滚动到列表的最后一个元素后添加一个元素到与listview关联的arrayadapter。 问题是它只是滚动到一个随机的位置 arrayadapter.add(item); //DOES NOT WORK CORRECTLY: listview.smoothScrollToPosition(arrayadapter.getCount()-1); //WORKS JUST FINE: listview.setSelection(arrayadapter.getCount()-1);

如何添加平滑滚动Bootstrap的滚动间谍function

我一直试图添加一个平滑的滚动function到我的网站一段时间,但似乎无法得到它的工作。 这是我的导航的HTML代码: <div id="nav-wrapper"> <div id="nav" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="675"> <div class="navbar-inner" data-spy="affix-top"> <div class="container"> <!– .btn-navbar is used as the toggle for collapsed navbar content –> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <!– Everything you want hidden at 940px or less, place within here –> <div class="nav-collapse […]

在Vim中顺利滚动的最好方法是什么?

Vim中的主要滚动命令是: Ctrl – B和Ctrl – F ,以及PageUp和PageDown滚动整页 Ctrl – U和Ctrl – D默认为半页滚动 Ctrl – Y和Ctrl – E滚动一行 前两者每次都失去了视觉上下文,所以我开发了重复击中后者的不良习惯( Ctrl – Y和Ctrl – E )。 由于目前没有第一方支持平滑滚动,所以最不引人注意的解决方法/插件是什么? 我根据任务使用Vim和GVim,如果没有一个真正适合两者的好黑客,我很乐意单独定制它们。 鼠标滚轮在GVim中很好地工作,但我正在寻找基于键盘的解决scheme。

Android:如何检测滚动何时结束

我正在使用GestureDetector.SimpleOnGestureListener的onScroll方法在canvas上滚动一个大的位图。 当滚动结束时,我想重绘位图,以防用户想要进一步滚动…离开位图的边缘,但是我看不到如何检测滚动何时结束(用户已经提起了他的手指从屏幕上)。 e2.getAction()似乎总是返回值2,所以没有帮助。 e2.getPressure似乎返回相当不变的值(大约0.25),直到最后的onScroll调用时,压力似乎下降到大约0.13。 我想我可以察觉到这种压力的减less,但这远非万无一失。 一定有更好的办法:请谁能帮忙?

jQuery从不同的页面滚动到ID

我试图在一些页面中使用jQuery的页面滚动,并可以顺利地进行页面滚动。 我现在唯一的问题是,当试图从不同的页面做到这一点。 我的意思是,如果我点击一个页面中的链接,它应该加载新的页面,然后滚动到特定的div元素。 这里是我用来在页面内滚动的代码: var jump=function(e) { //prevent the "normal" behaviour which would be a "hard" jump e.preventDefault(); //Get the target var target = $(this).attr("href"); //perform animated scrolling $('html,body').animate( { //get top-position of target-element and set it as scroll target scrollTop: $(target).offset().top //scrolldelay: 2 seconds },2000,function() { //attach the hash (#jumptarget) to the pageurl location.hash […]