uikit
Version:
UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.
59 lines (44 loc) • 1.72 kB
HTML
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Scroll - UIkit tests</title>
<script src="js/test.js"></script>
</head>
<body>
<div class="uk-container">
<h1>Scroll</h1>
<a class="uk-button uk-button-default" href="#bottom" uk-scroll>Go Down!</a>
<a id="js-top-callback" class="uk-button uk-button-default" href="#bottom" uk-scroll>Go Down with callback!</a>
<div style="height: 2000px;"></div>
<a id="bottom" class="uk-button uk-button-default" href="#" uk-scroll>Go Up!</a>
<script>
UIkit.util.on('#js-top-callback', 'scrolled', function () {
alert('Done.');
});
</script>
<h2>JavaScript Options</h2>
<div class="uk-overflow-auto">
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>offset</code></td>
<td>Number</td>
<td>0</td>
<td>Offset added to scroll top.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>