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
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: src/position/docs/readme.md
+43-25
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,26 @@ Calculates the browser scrollbar width and caches the result for future calls.
54
54
*_(Type: `number`)_ -
55
55
The width of the browser scrollbar.
56
56
57
+
#### isScrollable(element, includeHidden)
58
+
59
+
Determines if an element is scrollable.
60
+
61
+
##### parameters
62
+
63
+
*`element`
64
+
_(Type: `element`)_ -
65
+
The element to check.
66
+
67
+
*`includeHidden`
68
+
_(Type: `boolean`, Default: `false`, optional)_ - Should scroll style of 'hidden' be considered.
69
+
70
+
##### returns
71
+
72
+
*_(Type: `boolean`)_ -
73
+
Whether the element is scrollable.
74
+
57
75
#### scrollParent(element, includeHidden)
58
-
76
+
59
77
Gets the closest scrollable ancestor. Concept from the jQueryUI [scrollParent.js](https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js).
60
78
61
79
##### parameters
@@ -91,21 +109,21 @@ An object with the following properties:
91
109
*`width`
92
110
_(Type: `number`)_ -
93
111
The width of the element.
94
-
112
+
95
113
*`height`
96
114
_(Type: `number`)_ -
97
115
The height of the element.
98
-
116
+
99
117
*`top`
100
118
_(Type: `number`)_ -
101
119
Distance to top edge of offset parent.
102
-
120
+
103
121
*`left`
104
122
_(Type: `number`)_ -
105
123
Distance to left edge of offset parent.
106
124
107
125
#### offset(element)
108
-
126
+
109
127
A read-only equivalent of jQuery's [offset](http://api.jquery.com/offset/) function, distance to viewport.
110
128
111
129
##### parameters
@@ -121,21 +139,21 @@ An object with the following properties:
Gets the elements available space relative to the closest scrollable ancestor. Accounts for padding, border, and scrollbar width.
140
158
Right and bottom dimensions represent the distance to the respective edge of the viewport element, not the top and left edge.
141
159
If the element edge extends beyond the viewport, a negative value will be reported.
@@ -145,11 +163,11 @@ If the element edge extends beyond the viewport, a negative value will be report
145
163
*`element`
146
164
_(Type: `element`)_ -
147
165
The element to get the viewport offset for.
148
-
166
+
149
167
*`useDocument`
150
168
_(Type: `boolean`, Default: `false`, optional)_ -
151
169
Should the viewport be the document element instead of the first scrollable element.
152
-
170
+
153
171
*`includePadding`
154
172
_(Type: `boolean`, Default: `true`, optional)_ -
155
173
Should the padding on the viewport element be accounted for, default is true.
@@ -161,21 +179,21 @@ An object with the following properties:
161
179
*`top`
162
180
_(Type: `number`)_ -
163
181
Distance to top content edge of the viewport.
164
-
182
+
165
183
*`bottom`
166
184
_(Type: `number`)_ -
167
185
Distance to bottom content edge of the viewport.
168
-
186
+
169
187
*`left`
170
188
_(Type: `number`)_ -
171
189
Distance to left content edge of the viewport.
172
-
190
+
173
191
*`right`
174
192
_(Type: `number`)_ -
175
193
Distance to right content edge of the viewport.
176
194
177
195
#### parsePlacement(placement)
178
-
196
+
179
197
Gets an array of placement values parsed from a placement string. Along with the 'auto' indicator, supported placement strings are:
180
198
181
199
* top: element on top, horizontally centered on host element.
@@ -208,11 +226,11 @@ An array with the following values:
208
226
*`[0]`
209
227
_(Type: `string`)_ -
210
228
The primary placement.
211
-
229
+
212
230
*`[1]`
213
231
_(Type: `string`)_ -
214
232
The secondary placement.
215
-
233
+
216
234
*`[2]`
217
235
_(Type: `boolean`)_ -
218
236
Is auto place enabled.
@@ -226,11 +244,11 @@ Gets gets coordinates for an element to be positioned relative to another elemen
226
244
*`hostElement`
227
245
_(Type: `element`)_ -
228
246
The element to position against.
229
-
247
+
230
248
*`targetElement`
231
249
_(Type: `element`)_ -
232
250
The element to position.
233
-
251
+
234
252
*`placement`
235
253
_(Type: `string`, Default: `top`, optional)_ -
236
254
The placement for the target element. See the parsePlacement() function for available options. If 'auto' placement is used, the viewportOffset() function is used to decide where the targetElement will fit.
@@ -246,11 +264,11 @@ An object with the following properties:
246
264
*`top`
247
265
_(Type: `number`)_ -
248
266
The targetElement top value.
249
-
267
+
250
268
*`left`
251
269
_(Type: `number`)_ -
252
270
The targetElement left value.
253
-
271
+
254
272
*`right`
255
273
_(Type: `number`)_ -
256
274
The resolved placement with 'auto' removed.
@@ -261,10 +279,10 @@ Positions the tooltip and popover arrow elements when using placement options be
0 commit comments