You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-20Lines changed: 37 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ jQuery.cuteScroll.defaults={
67
67
},
68
68
//element:{}, - you can change properties of every element you want
69
69
on:{//related to events
70
-
contentChange:false,// expects function which is called on content change -> onContentChange: <function>
70
+
contentChange:false,// expects a function which is called on content change
71
71
contentChangeShowScroller:true,// show scroller on content change if it is reasonable
72
72
},
73
73
//priority:1,//defines overlapping priority, not supported for now
@@ -95,14 +95,14 @@ jQuery.cuteScroll({
95
95
```
96
96
97
97
### Commands
98
-
- create:`<object>` - creates a scroller
99
-
- recreate:`<object>` - recreates a scroller
100
-
- update:`<object>` - updates settings
101
-
- jumpToTop:`<boolean>` - jumps to the top of a scrollable div if TRUE
102
-
- jumpToBottom:`<boolean>` - jumps to the bottom of a scrollable div if TRUE
103
-
- log:`<string>` - logs some message via console
104
-
- alert:`<string>` - alerts some message
105
-
- remove:`<boolean>` - removes a scroller if TRUE
98
+
- create:`object` - creates a scroller
99
+
- recreate:`object` - recreates a scroller
100
+
- update:`object` - updates settings
101
+
- jumpToTop:`boolean` - jumps to the top of a scrollable div if TRUE
102
+
- jumpToBottom:`boolean` - jumps to the bottom of a scrollable div if TRUE
103
+
- log:`string` - logs some message via console
104
+
- alert:`string` - alerts some message
105
+
- remove:`boolean` - removes a scroller if TRUE
106
106
107
107
### AddClass, removeClass
108
108
You can add or remove any class of a scroller element. All changes will be reversed on the remove command
@@ -127,17 +127,34 @@ jQuery.cuteScroll({
127
127
You can also edit other elements properties by tag, class or id name or just change their css values. All changes will be reversed on the remove command
128
128
```javascript
129
129
jQuery.cuteScroll({
130
-
update:{// is the command object
131
-
element:{
132
-
'myElementClass':{
133
-
// any css settings
134
-
height:'100rem',
135
-
background:'red',
136
-
addClass:'classNameToAdd'
137
-
},
138
-
'myOtherElementClass':{
139
-
// any css settings
140
-
removeClass:'classNameToRemove'
130
+
create:{// is the command object
131
+
bar:{
132
+
// any css settings
133
+
addClass:'newMyBarClass'
134
+
removeClass:'formerMyBarClass'
135
+
},
136
+
area:{
137
+
// any css settings
138
+
width:'100vw',
139
+
height:'100vh'
140
+
},
141
+
}
142
+
});
143
+
```
144
+
145
+
### Listeners
146
+
#### on.contentChange
147
+
Expects a function which will be called on a scrollable element content change
148
+
```javascript
149
+
jQuery.cuteScroll({
150
+
create:{// is the command object
151
+
on:{
152
+
contentChange:function(e){// e - is the scrollable element jQuery object
0 commit comments