Skip to content

Make complete callback always fire #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ And that's it really. This is of course if we use defaults. It also supports som
* **x** or **horizontal**
* **y** or **vertical**
* **both** - scrolling will perform in both directions; since scrolling is performed only when element is actually out of view this simply means that scrolling may only perform in one direction even though you set it to scroll in both directions; *both* is therefore the most reliable scrolling option that will make sure your element will be visible
* **complete** function - this is the complete handler function that will get called when scrolling completes; it runs in context of scrollable element; this function will be called regardless whether scrolling will perform or not (when element already in view); *but* it won't get called when there's no scrollable element (context can't be determined)
* **complete** function - this is the complete handler function that will get called when scrolling completes; it runs in context of scrollable element; this function will be called regardless whether scrolling will perform or not (when element already in view);

```javascript
$("some_selector").scrollintoview({
Expand Down
4 changes: 4 additions & 0 deletions jquery.scrollintoview.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@
$.isFunction(options.complete) && options.complete.call(scroller[0]);
}
}
else {
// If there's no scrollable ancestors then we should call the "complete" function immediately
$.isFunction(options.complete) && options.complete.call(null);
}

// return set back
return this;
Expand Down
11 changes: 0 additions & 11 deletions jquery.scrollintoview.min.js

This file was deleted.