Skip to content

Commit e862213

Browse files
lukasbeschrigor789
authored andcommitted
feat: pass additional parameters to offset callback (#135)
* Add parameter to offset callback function * build vue-scrollto.js
1 parent d2a0e05 commit e862213

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/scrollTo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export const scroller = () => {
166166
var cumulativeOffsetElement = _.cumulativeOffset(element);
167167

168168
if (typeof offset === "function") {
169-
offset = offset();
169+
offset = offset(element, container);
170170
}
171171

172172
initialY = scrollTop(container);

vue-scrollto.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
var cumulativeOffsetElement = _.cumulativeOffset(element);
379379

380380
if (typeof offset === "function") {
381-
offset = offset();
381+
offset = offset(element, container);
382382
}
383383

384384
initialY = scrollTop(container);

0 commit comments

Comments
 (0)