jQuery.mobile.silentScroll()


jQuery.mobile.silentScroll( yPos )Returns: jQuery

Description: Scroll to a particular Y position without triggering scroll event listeners.

Scroll to a particular Y position without triggering scroll event listeners.

Example:

scroll to Y 100px

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery.mobile.silentScroll demo</title>
<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>silentScroll() example</h1>
</div>
<div role="main" class="ui-content">
<a href="#" onclick="$.mobile.silentScroll(100)" data-role="button">Go down 100 pixels</a>
<p> <br><br>Here, we have some text so that we can have <br>
some vertical space in order to demonstrate <br>
the silentScroll() method.<br><br></p>
<a href="#" onclick="$.mobile.silentScroll(0)" data-role="button">Back to Top</a>
</div>
<div data-role="footer">
<h4> </h4>
</div>
</div>
</body>
</html>

Demo: