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