Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Technical Documentation Page - SmoothScroll script conflict with test suite script #650

Closed
alexdisdier opened this issue Oct 18, 2018 · 1 comment
Labels
other: decayed Stale issues that need follow up from commentators. Should be closed in 7 days of no activity.

Comments

@alexdisdier
Copy link

Issue Description for the Technical Documentation Page

I included a script for a smoothScroll navigation of navbar links but it generates an error and only passes 15 out 16 tests. If I remove the smoothScroll I pass 16 out of 16 tests.

The message from your test script stipulates: "...the element with id="navbar" should be shown on the left half of the screen." and "window.scroll is not a function
TypeError: window.scroll is not a function".
-> The navbar is on the left of the screen

Browser Information

  • Browser Name, Version: Version 69.0.3497.100 (Official Build) (64-bit)
  • Operating System: MacOS High Sierra Version 10.13.6
  • Mobile, Desktop, or Tablet: all of them

Your Code / Link to Your Pen

https://codepen.io/alexdisdier/pen/NOYxxb (without the smoothScroll script - passing all the test s suite)
https://alexdisdier.github.io/vcard-documentation/ (with the smoothScroll script - failing one test)

@ValeraS
Copy link
Contributor

ValeraS commented Oct 18, 2018

@alexdisdier scroll is predefined method on the window object https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll. To avoid the issue you can rename your variable scroll or don't use the variable at all:

new SmoothScroll('a[href*="#"]');

@ValeraS ValeraS added the other: decayed Stale issues that need follow up from commentators. Should be closed in 7 days of no activity. label Dec 24, 2018
@ValeraS ValeraS closed this as completed Dec 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
other: decayed Stale issues that need follow up from commentators. Should be closed in 7 days of no activity.
Projects
None yet
Development

No branches or pull requests

2 participants