mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added jquery.slimScroll typings and their test file. Updated CONTRIBUTORS.md.
This commit is contained in:
+1
-1
@@ -664,4 +664,4 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov)
|
||||
|
||||
* [:link:](jquery.slimScroll/jquery.slimScroll.d.ts) [jquery.slimScroll](https://github.com/rochal/jQuery-slimScroll) by [Chintan Shah](https://github.com/Promact)
|
||||
@@ -0,0 +1,46 @@
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="jquery.slimScroll.d.ts"/>
|
||||
|
||||
$("div").slimScroll();
|
||||
|
||||
$("div").slimScroll({
|
||||
width: '300px',
|
||||
height: '500px',
|
||||
size: '10px',
|
||||
position: 'left',
|
||||
color: '#ffcc00',
|
||||
alwaysVisible: true,
|
||||
distance: '20px',
|
||||
start: $('#child_image_element'),
|
||||
railVisible: true,
|
||||
railColor: '#222',
|
||||
railOpacity: 0.3,
|
||||
wheelStep: 10,
|
||||
allowPageScroll: false,
|
||||
disableFadeOut: false
|
||||
});
|
||||
|
||||
|
||||
$(function(){
|
||||
$('#inner-content-div').slimScroll({
|
||||
height: '250px'
|
||||
});
|
||||
});
|
||||
|
||||
$('#slimtest2').slimScroll({
|
||||
position: 'left',
|
||||
height: '150px',
|
||||
railVisible: true,
|
||||
alwaysVisible: true
|
||||
});
|
||||
|
||||
$('#slimtest3').slimScroll({
|
||||
color: '#00f',
|
||||
size: '10px',
|
||||
height: '180px',
|
||||
alwaysVisible: true
|
||||
});
|
||||
|
||||
$("div").slimScroll().bind('slimscroll', function(e){
|
||||
console.log("Reached " + e);
|
||||
});
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
// Type definitions for jQuery.slimScroll v1.3.3
|
||||
// Project: https://github.com/rochal/jQuery-slimScroll
|
||||
// Definitions by: Chintan Shah <https://github.com/Promact>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface IOptions {
|
||||
// width in pixels of the visible scroll area
|
||||
width? :string;
|
||||
// height in pixels of the visible scroll area
|
||||
height? :string;
|
||||
// width in pixels of the scrollbar and rail
|
||||
size? :string;
|
||||
// scrollbar color, accepts any hex/color value
|
||||
color?:string;
|
||||
// scrollbar position - left/right
|
||||
position?:string;
|
||||
// distance in pixels between the side edge and the scrollbar
|
||||
distance?:string;
|
||||
// default scroll position on load - top / bottom / $('selector')
|
||||
start?:any;
|
||||
// sets scrollbar opacity
|
||||
opacity? :number;
|
||||
// enables always-on mode for the scrollbar
|
||||
alwaysVisible?: boolean;
|
||||
// check if we should hide the scrollbar when user is hovering over
|
||||
disableFadeOut?: boolean;
|
||||
// sets visibility of the rail
|
||||
railVisible?: boolean;
|
||||
// sets rail color
|
||||
railColor?: string;
|
||||
// sets rail opacity
|
||||
railOpacity?:number;
|
||||
// whether we should use jQuery UI Draggable to enable bar dragging
|
||||
railDraggable?: boolean;
|
||||
// defautlt CSS class of the slimscroll rail
|
||||
railClass?: string;
|
||||
// defautlt CSS class of the slimscroll bar
|
||||
barClass?: string;
|
||||
// defautlt CSS class of the slimscroll wrapper
|
||||
wrapperClass?: string;
|
||||
// check if mousewheel should scroll the window if we reach top/bottom
|
||||
allowPageScroll?: boolean;
|
||||
// scroll amount applied to each mouse wheel step
|
||||
wheelStep?: number;
|
||||
// scroll amount applied when user is using gestures
|
||||
touchScrollStep?: number;
|
||||
// sets border radius
|
||||
borderRadius?: string;
|
||||
// sets border radius of the rail
|
||||
railBorderRadius?: string;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
slimScroll:{
|
||||
(): JQuery;
|
||||
(options:IOptions): JQuery;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user