Skip to content

Commit

Permalink
Updated to version 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkek committed Mar 4, 2014
1 parent 637c16b commit 8348389
Show file tree
Hide file tree
Showing 29 changed files with 1,268 additions and 310 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
jquery-tinyscrollbar
====================

Tiny Scrollbar is a nice and elegant way to enable the scrolling of content on mobile and desktop devices. It was built using the javascript jQuery library. Tiny scrollbar was designed to be a dynamic lightweight utility that gives webdesigners a powerfull way of enhancing a websites user interface.
Tiny Scrollbar is a nice and elegant way to enable the scrolling of content on mobile and desktop devices. Its designed to be a dynamic lightweight utility. Furthermore it gives a User Interface Designer a powerful way of enhancing the Ui (user interface) of a website.

### Features
It comes in 2 flavors as a vanilla Javascript microlib and a jQuery plugin. The jQuery plugin does not need any other external libaries like jQuery Ui.

Browser support differs between the jQuery plugin and the plain Javascript microlib. Specifically, the plain Javascript microlib does not support legacy browsers such as IE6-8. Use the jQuery plugin release if support for those browsers is required.

* IOS and Android support.
### Features
* *Completely rewritten!*
* *IOS and Android support.*
* *Available as a jQuery plugin and as a vanilla Javascript microlib.*
* AMD, Node, requirejs and commonjs support.
* Can scroll vertical or horizontal
* Supports scrolling by wheel, thumb, track or touch.
* It has a update function so it can handle content changes and async requests.
* Size of the scrollbar track and thumb can be set to auto or a fixed number
* It has a update function so it can handle (async) content changes.
* Size of the track and thumb can be set to auto or a fixed number
* Easy customizable
* Supports normal scrolling and mobile style invert scrolling.
* Examples can be seen on this page, by downloading the zip or here
* Lightweight

#### License
Expand Down
68 changes: 0 additions & 68 deletions css/website.css

This file was deleted.

10 changes: 10 additions & 0 deletions infinite/css/website.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* Tiny Scrollbar */
#scrollbar1 { width: 520px; margin: 20px 0 10px; }
#scrollbar1 .viewport { width: 500px; height: 200px; overflow: hidden; position: relative; }
#scrollbar1 .overview { list-style: none; position: absolute; left: 0; top: 0; padding: 0; margin: 0; }
#scrollbar1 .scrollbar{ background: transparent url(../images/bg-scrollbar-track-y.png) no-repeat 0 0; position: relative; background-position: 0 0; float: right; width: 15px; }
#scrollbar1 .track { background: transparent url(../images/bg-scrollbar-trackend-y.png) no-repeat 0 100%; height: 100%; width:13px; position: relative; padding: 0 1px; }
#scrollbar1 .thumb { background: transparent url(../images/bg-scrollbar-thumb-y.png) no-repeat 50% 100%; height: 20px; width: 25px; cursor: pointer; overflow: hidden; position: absolute; top: 0; left: -5px; }
#scrollbar1 .thumb .end { background: transparent url(../images/bg-scrollbar-thumb-y.png) no-repeat 50% 0; overflow: hidden; height: 5px; width: 25px; }
#scrollbar1 .disable { display: none; }
.noSelect { user-select: none; -o-user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; }
File renamed without changes
File renamed without changes
File renamed without changes
67 changes: 67 additions & 0 deletions infinite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!doctype html>
<html lang="en">
<head>
<title>Tiny Scrollbar: A crossbrowser lightweight javascript/jQuery scrollbar.</title>

<meta charset="utf-8">
<meta name="description" content="A crossbrowser lightweight javascript/jQuery scrollbar." />

<link rel="stylesheet" href="css/website.css" type="text/css" media="screen"/>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.tinyscrollbar.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
var $scrollbar = $('#scrollbar1')
, $overview = $scrollbar.find(".overview")
, loadingData = false
;

$scrollbar.tinyscrollbar({thumbSize : 20});

var scrollbarData = $scrollbar.data("plugin_tinyscrollbar")

$scrollbar.bind("move", function()
{
// The threshold will enable us to start loading the text before we reach the end.
//
var threshold = 0.9
, positionCurrent = scrollbarData.contentPosition + scrollbarData.viewportSize
, positionEnd = scrollbarData.contentSize * threshold
;

// Check if have reached the "end" and that we arent allready in the process of loading new data.
//
if(!loadingData && positionCurrent >= positionEnd)
{
loadingData = true;

$.getJSON("json/data.json", function(data)
{
loadingData = false;

$overview.append(data.text)

scrollbarData.update("relative");
});
}
});
});
</script>

</head>
<body>
<div id="scrollbar1">
<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<h3>Magnis dis parturient montes</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vitae velit at velit pretium sodales. Maecenas egestas imperdiet mauris, vel elementum turpis iaculis eu. Duis egestas augue quis ante ornare eu tincidunt magna interdum. Vestibulum posuere risus non ipsum sollicitudin quis viverra ante feugiat. Pellentesque non faucibus lorem. Nunc tincidunt diam nec risus ornare quis porttitor enim pretium. Ut adipiscing tempor massa, a ullamcorper massa bibendum at. Suspendisse potenti. In vestibulum enim orci, nec consequat turpis. Suspendisse sit amet tellus a quam volutpat porta. Mauris ornare augue ut diam tincidunt elementum. Vivamus commodo dapibus est, a gravida lorem pharetra eu. Maecenas ultrices cursus tellus sed congue. Cras nec nulla erat.</p>

<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eget mauris libero. Nulla sit amet felis in sem posuere laoreet ut quis elit. Aenean mauris massa, pretium non bibendum eget, elementum sed nibh. Nulla ac felis et purus adipiscing rutrum. Pellentesque a bibendum sapien. Vivamus erat quam, gravida sed ultricies ac, scelerisque sed velit. Integer mollis urna sit amet ligula aliquam ac sodales arcu euismod. Fusce fermentum augue in nulla cursus non fermentum lorem semper. Quisque eu auctor lacus. Donec justo justo, mollis vel tempor vitae, consequat eget velit.</p>
</div>
</div>
</div>
</body>
</html>

0 comments on commit 8348389

Please sign in to comment.