snipt

Ctrl+h for KB shortcuts

CSS

Native style momentum scrolling to arrive in iOS 5

1
2
3
4
element {
	overflow: scroll;
	-webkit-overflow-scrolling: touch;
}
https://snipt.net/embed/0fd63372964650875f919b4be9b3d8a6/
/raw/0fd63372964650875f919b4be9b3d8a6/
0fd63372964650875f919b4be9b3d8a6
css
CSS
4
2019-06-26T14:13:06
True
False
False
Jan 24, 2013 at 08:53 AM
/api/public/snipt/54385/
native-style-momentum-scrolling-to-arrive-in-ios-5
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">element</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">overflow</span><span class="o">:</span> <span class="nb">scroll</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="o">-</span><span class="n">webkit</span><span class="o">-</span><span class="nb">overflow</span><span class="o">-</span><span class="n">scrolling</span><span class="o">:</span> <span class="n">touch</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
ios, ipad, iphone, mobile, scrolling

JavaScript

Scroll To Top JS

1
2
3
4
5
$('#nome_div_pulsante').click(function() {
	$('html, body').animate({ scrollTop:0 }, 'fast');
	return false;
});
 
https://snipt.net/embed/ebb1384182771e7261876066aaaf6f53/
/raw/ebb1384182771e7261876066aaaf6f53/
ebb1384182771e7261876066aaaf6f53
js
JavaScript
5
2019-06-24T23:11:03
True
False
False
/api/public/snipt/21713/
scroll-to-top-js
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#nome_div_pulsante&#39;</span><span class="p">).</span><span class="nx">click</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;html, body&#39;</span><span class="p">).</span><span class="nx">animate</span><span class="p">({</span> <span class="nx">scrollTop</span><span class="o">:</span><span class="mi">0</span> <span class="p">},</span> <span class="s1">&#39;fast&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">});</span> </span><span id="L-5"><a name="L-5"></a> </span></pre></div> </td></tr></table>
jquery, scroll, scrolling, top