Skip to content
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

Check if element exists #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

egoist
Copy link

@egoist egoist commented Dec 16, 2016

No description provided.

@espehel
Copy link

espehel commented Jan 30, 2018

Any chance of seeing this PR merged? @callmecavs

@callmecavs
Copy link
Owner

callmecavs commented Jan 30, 2018

@espehel probably not as is - the PR includes a bunch of other changes that go against the code style, etc.

it's easy enough to implement this outside the library, as follows:

const target = document.querySelector('selector')

if (!target) {
  // handle invalid target here
  return
} else {
  jump(target, { duration: 1000 })
}

the check might also need to be a bit more complete - like test for instanceof HTMLElement or something along those lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants