Smooth scroll angular2

there is a method in the window object called scrollTo(). If you set the behavior to ‘smooth’ the page will handle the smooth scroll. example (scroll to top of page): window.scrollTo({ left: 0, top: 0, behavior: ‘smooth’ }); And with fallback example: try { window.scrollTo({ left: 0, top: 0, behavior: ‘smooth’ }); } catch (e) … Read more

Disable scrolling and bounce effect on mobile Safari

This answer is no longer state of the art, unless you are developing for a very old iOS device… Please see other solutions 2011 answer: For a web/html app running inside iOS Safari you want something like document.ontouchmove = function(event){ event.preventDefault(); } For iOS 5 you may want to take the following into account: document.ontouchmove … Read more

How to make Scrollable text in flutter?

You need to wrap your SingleChildScrollView in an Expanded widget and you will get what you are looking for. import ‘package:flutter/material.dart’; void main() => runApp(new MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: ‘Flutter Demo’, theme: new ThemeData( primarySwatch: Colors.blue, ), home: new MyHomePage(), ); } } class … Read more

scrollintoview animation

In most modern browsers (Chrome and Firefox, but not Safari, UC, or IE) you can pass options in an object to .scrollIntoView(). Try this: elm.scrollIntoView({ behavior: ‘smooth’, block: ‘center’ }) Other values are behavior: ‘instant’ or block: ‘start’ or block: ‘end’. See https://developer.mozilla.org/en/docs/Web/API/Element/scrollIntoView

Hide FloatingActionButton on scroll of RecyclerView

Easiest solution: recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { if (dy > 0 ||dy<0 && fab.isShown()) { fab.hide(); } } @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { if (newState == RecyclerView.SCROLL_STATE_IDLE) { fab.show(); } super.onScrollStateChanged(recyclerView, newState); } });

-webkit-overflow-scrolling: touch; breaks in Apple’s iOS8

I had a similar problem with a (quite complex) nested scrollable div which scrolled fine in iOS 5, 6 and 7, but that intermittently failed to scroll in iOS 8.1. The solution I found was to remove all the CSS that tricks the browser into using the GPU: -webkit-transform: translateZ(0px); -webkit-transform: translate3d(0,0,0); -webkit-perspective: 1000; By … Read more