dynamic-content.html
2.37 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jquery.slimscroll - dynamic content</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<link href="libs/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="libs/prettify/prettify.js"></script>
<script type="text/javascript" src="../jquery.slimscroll.js"></script>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<a id="git-fork" href="https://github.com/rochal/jQuery-slimScroll"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
<div class="examples">
<div id="testDiv">
</div>
<pre class="prettyprint">
// update content every second
setInterval(function(){
var el = $('<div></div>').html('#' + $('#testDiv').children().length)
.css({ padding: '3px', border: '1px solid #ccc', margin: '5px' });
$('#testDiv').append(el);
// update slimscroll every time content changes
$('#testDiv').slimscroll();
}, 1000);
$('#testDiv').slimscroll({
alwaysVisible: true,
height: 150
});
</pre>
</div>
<script type="text/javascript">
$(function(){
// update content every second
setInterval(function(){
var el = $('<div></div>').html('#' + $('#testDiv').children().length)
.css({ padding: '3px', border: '1px solid #ccc', margin: '5px' });
$('#testDiv').append(el);
// update slimscroll every time content changes
$('#testDiv').slimscroll();
}, 1000);
$('#testDiv').slimscroll({
alwaysVisible: true,
height: 150
});
});
</script>
<script type="text/javascript">
//enable syntax highlighter
prettyPrint();
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3112455-22']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>