1.0.0 • Published 8 years ago

miniscroll_js v1.0.0

Weekly downloads
5
License
-
Repository
github
Last release
8 years ago

License

Miniscroll is a little library for touch and desktop scrollbar application. if you found bugs send it to rogerluizm@gmail.com or send to issue page

check my dev branch

version 1.3.0

Include miniscroll.js into your page:

<script src="miniscroll.js"></script>

Include the html tag and add id or class:

<div class="scroller">
     <!-- text here -->
</div>

CSS of the div ".scroller":

.scroller {
     width: 400px;
     height: 300px;
     overflow: hidden;
}

Initialize the miniscroll:

new Miniscroll(".scroller", {
     axis: "y",
     size: 10,
     sizethumb: "auto",
     onScroll: function(percent, offset) {},
     thumbColor: "#0e5066",
     trackerColor: "#1a8bb2"
 });

Change the color and aparence for all miniscroll class:

.miniscroll-thumb {
     background-color: #0e5066 !important;
}

.miniscroll-tracker {
    background-color: #1a8bb2 !important;
}

Change the color and aparence for a unique miniscroll id:

#miniscroll-target .miniscroll-thumb {
    background-color: #0e5066 !important;
}

#miniscroll-target .miniscroll-tracker {
    background-color: #1a8bb2 !important;
}

List of parameters:

ParametersDesc
axisaxle of scrollbar ex: "y" ou "x"
sizethe width of scrollbar ex: 10
sizethumbthe height of thumb ex: 100 ou "auto"
scrollbarSizesize of scrollbar, you can set a size fix to scrollbar it ex: 300 this had left scrollbar with the height of 300px
thumbColorthe size of thumb ex: "#0e5066"
trackerColorcolor of fund of tracker ex: "#1a8bb2"
isKeyEventAdd arrow key event, by default is true
turnOffWheeltoggle on or off a mousewheel event, by default turnOffWheel is true

Last update:

VersionDateUpdate
1.2.910/09/2013fix multidimensional scrollwheel
1.2.910/09/2013fix error in the scroll when the position is relative or absolute
1.2.910/09/2013fix updating on the x axis
1.2.803/09/2013add turn off mousewheel, ex: { mousewheel: true }
1.2.703/09/2013add scrollTo, now its posible scroll to a custom positio
1.2.603/09/2013fix bug the whole scrollbar (not just the handler part) moves down when I drag it
1.2.503/09/2013fix the position the thumb when key press down and up
1.2.403/09/2013fixbug error it's time to catching the width and height
1.2.303/09/2013fix scrollbar position "x"
1.2.203/09/2013Key event added, now you can press the key down and key up for scrolling
1.2.103/09/2013Touch event added, now works for ipad, iphone and android

Browser compatibility

ChromeFirefoxIEEdgeOperaSafari
Latest ✔Latest ✔9+ ✔Latest ✔Latest ✔3.2+ ✔

The MIT License (MIT)

Copyright (c)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.