scroller

Continuously scrolling horizontal ticker containing images in jQuery?

笑着哭i 提交于 2019-11-28 06:26:04
I would like to do something like this: http://javascript.about.com/library/blcmarquee1.htm The script I referenced however seems to be a bit laggy (outdated?), so I was wondering if anyone knew of a better solution. (jQuery solutions welcome.) megaSteve4 Just found this — jQuery-driven, and has images. I’m intending to use it for a current project. http://logicbox.net/jquery/simplyscroll/ UPDATE: I have now used this in production code. The plugin is capable of looping 70+ 150×65px images pretty smoothly - which a number of another plugin I tried similar to this were failing on. NOTE it

利用Scroller实现弹性滑动

雨燕双飞 提交于 2019-11-28 04:23:57
使用Scroller 实现弹性滑动的源码如下 Scroller scroller=new Scroller(mContext); private void smoothScroolBy(int destx, int desty) { int scrollX=getScrollx(); int deltax=destx-scrollx; mScroller.startScroll(scrollX, 0, deltax, 0,1000); //1000ms内滑向deltax,效果就是慢慢滑 invalidate(); } @Override public void computeScroll() { if (mScroller.computeScrollOffset()) { scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); postInvalidate(); } } 原理: 1.构造一个Scroller对象,并调用startScroll方法。Scroller仅用来保存参数,无实际作用 2.invalidate会导致view重绘,draw又会调用computeScroll 3.computeScroll在view中为空方法,所以需要自己实现 4.postInvalidate再次重绘。并且会再次调用computeScroll

egret用eui地图滚动

天涯浪子 提交于 2019-11-27 12:58:33
var group = new eui.Group(); var img = new eui.Image("resource/assets/bg.jpg"); group.addChild(img); //创建一个Scroller var myScroller = new eui.Scroller(); //注意位置和尺寸的设置是在Scroller上面,而不是容器上面 myScroller.width = 400; myScroller.height = 400; //设置viewport myScroller.viewport = group; this.addChild(myScroller); var shang:egret.Shape = new egret.Shape; shang.graphics.beginFill( 16033 ); shang.graphics.drawRect( 80, 460, 60,60 ); shang.graphics.endFill(); shang.touchEnabled=true; shang.addEventListener(egret.TouchEvent.TOUCH_TAP,bshang,this); this.addChild(shang);//将bg添加到舞台上 function bshang(){ myScroller

Continuously scrolling horizontal ticker containing images in jQuery?

别等时光非礼了梦想. 提交于 2019-11-27 01:25:33
问题 I would like to do something like this: http://javascript.about.com/library/blcmarquee1.htm The script I referenced however seems to be a bit laggy (outdated?), so I was wondering if anyone knew of a better solution. (jQuery solutions welcome.) 回答1: Just found this — jQuery-driven, and has images. I’m intending to use it for a current project. http://logicbox.net/jquery/simplyscroll/ UPDATE: I have now used this in production code. The plugin is capable of looping 70+ 150×65px images pretty