From 1b8a298d04a9b317a90f7d2300fd395fe1dbf75c Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 3 Mar 2018 14:41:49 +0200 Subject: [PATCH] Update smoothScroll.md --- snippets/smoothScroll.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/snippets/smoothScroll.md b/snippets/smoothScroll.md index 9165715d2..de024bf68 100644 --- a/snippets/smoothScroll.md +++ b/snippets/smoothScroll.md @@ -2,7 +2,8 @@ Smoothly scrolls the element on which it's called into the visible area of the browser window. -Use `.scrollIntoView` method to scroll the element. Pass `{ behavior: 'smooth' }` to `.scrollIntoView` so it scrolls smoothly. +Use `.scrollIntoView` method to scroll the element. +Pass `{ behavior: 'smooth' }` to `.scrollIntoView` so it scrolls smoothly. ```js const smoothScroll = element => @@ -12,6 +13,6 @@ const smoothScroll = element => ``` ```js -smoothScroll('#fooBar'); // scrolls smoothly to the element with the id of fooBar -smoothScroll('.fooBar'); // scrolls smoothly to the element with the class of fooBar +smoothScroll('#fooBar'); // scrolls smoothly to the element with the id fooBar +smoothScroll('.fooBar'); // scrolls smoothly to the first element with a class of fooBar ```