# scrollTo

**URL:** <https://forum.wixstudio.com/t/scrollto/16247>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [March 4, 2019, 2:36pm UTC](https://forum.wixstudio.com/t/scrollto/16247 "2019-03-04T14:36:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [March 4, 2019, 2:36pm UTC](https://forum.wixstudio.com/t/scrollto/16247/1 "2019-03-04T14:36:44Z")

</div>

Is it possible to use scrollTo without scrolling animation?  
Thanks,  
J.D.  
#scrollTo #animation #scrolling

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [March 4, 2019, 11:43pm UTC](https://forum.wixstudio.com/t/scrollto/16247/2 "2019-03-04T23:43:52Z")

</div>

This might not work as it isn’t an animation that you can hide as it is a code function, however see if this is any good for you:

> **[Velo by Wix: Full-Stack Web Dev | Build Professional Web Apps](https://community.wix.com/velo/forum/coding-with-velo/a-trick-for-animation-with-duration-delay)**
>
> Ask questions, get answers from the community and stay up-to-date with new features.

Obviously try changing the above code for the scrollTo:

> **[Anchor - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/$w/anchor)**
>
> Anchors are invisible position markers which you can place anywhere on your site.

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [March 5, 2019, 11:27am UTC](https://forum.wixstudio.com/t/scrollto/16247/3 "2019-03-05T11:27:15Z")

</div>

Thank you, @givemeawhisky ,  
I don’t think that can help me (but I’m not really sure I got the suggestion there).  
Let me explain what I’m trying to achieve, and maybe you’ll have an idea how to do it right.  
So, I have a BACK button on the page and I want the users not only to go to the previous page but to be there in the same scrolling position as they were when they left it. To do so I run getBoundingRect( ) before they leave the first page, and then when they click BACK I use scrollTo with the retrieved windowSizeInfo.scroll.y . It works fine, but I don’t need there the scrolling animation.  
Any idea?  
Thanks,  
J.D.

---

<div class="post-metadata">

**Author:** ![gordond](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@gordond](https://forum.wixstudio.com/u/gordond)\
**Post date:** [July 17, 2020, 8:36am UTC](https://forum.wixstudio.com/t/scrollto/16247/4 "2020-07-17T08:36:33Z")

</div>

Hi J.D. did you manage to get a resolution to this? I am attempting to load a new page and have it scroll to the same position as the current page, ideally without a scroll animation.

---

<div class="post-metadata">

**Author:** ![wix47224](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@wix47224](https://forum.wixstudio.com/u/wix47224)\
**Post date:** [December 4, 2020, 12:07am UTC](https://forum.wixstudio.com/t/scrollto/16247/5 "2020-12-04T00:07:13Z")

</div>

Does this help?  
[https://www.wix.com/corvid/reference/wix-window/scrollto](https://www.wix.com/corvid/reference/wix-window/scrollto)

```javascript
function scrollTo(x: number, y: number,[options: ScrollToOptions]):Promise<void>

```

scrollAnimation  
boolean  
Indicates whether to scroll with an animation. Defaults to true.

so:

```javascript
wixWindow.scrollTo(100, 500, {"scrollAnimation": false});

```

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 16, 2021, 11:29am UTC](https://forum.wixstudio.com/t/scrollto/16247/6 "2021-02-16T11:29:18Z")

</div>

Hello,  
Even though this is a rather old post - I am trying to solve an issue which _seems related_ to what you guys have been discussing here… and since I see a number of ‘Velo Masters’ in the thread [@jonatandor35 / @givemeawhisky], I thought I’d try my luck here!

[BTW - I am a _total novice_ at coding - so, please pardon my naivete !]

I have a ‘back to top’ button on my footer - _NOT_ the built-in button that wix provides - but a separate icon - #shape31

When clicked, I want the page to jump to the top _WITHOUT_ the inherent page-animation.

And the following code is doing _THIS PART_ of the job fine!

export function shape31\_click(event) {  
wixWindow.scrollTo( 0 , 0 , { “scrollAnimation” : **false** })  
}

However, when the page jumps to the top, in response to this button-click - another _UNWANTED issue_ is coming in the way…

Issue:-  
My HEADER - which has a “Disappears” setting - is _NOT GETTING REVEALED_ !

I have tried adding other bits of code - as below… but none of that is helping…

export function shape31\_click(event) {  
wixWindow.scrollTo( 0 , 0 , { “scrollAnimation” : **false** });

**//trial code addition 1**  
$w( ‘#header1’ ).expand();

//to this, wix says “’ expand ’ [or show()] does not exist on ‘#header1’”

**/trial code addition 2**  
( ‘#columnStrip14’ ).expand()

// #columnStrip14 is the main container _within_ the Header - but this code has no effect on the header being shown either, obviously!  
}

Any ideas… anyone?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [February 17, 2021, 1:25pm UTC](https://forum.wixstudio.com/t/scrollto/16247/7 "2021-02-17T13:25:45Z")

</div>

You cannot expand or collapse header via Velo (only with custom elements or custom code).  
However I don’t understand the issue. If you set the page layout to “Standard” the header will always show up no matter what Velo code you have. And if you set it to “No Header & Footer” it won’t show up no matter which Velo code you have there.

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 19, 2021, 10:50am UTC](https://forum.wixstudio.com/t/scrollto/16247/8 "2021-02-19T10:50:22Z")

</div>

Hello @jonatandor35 ,

Thank you for responding!

**Clarification1 ~**  
[Not sure I understand you correctly?!]

When you say, " You cannot expand or collapse header via Velo (only with custom elements or custom code) " ~

Do you mean that it _can be done_ using the _CODE PANEL_ (“custom code”) - but not through the customisations that Velo allows for an element?

If so, then that is what I have been trying to do - write _custom code_ in the code panel - to try and make the header appear, whenever the viewport goes to TOP of the page…

i.e. I am _NOT_ trying to achieve the same using inbuilt customisations - rather, trying to do it with code that _I write within the code panel._

**Clarification2 ~**  
It is not about the page layout - which is, incidentally, _set to Standard_ , as you suggest…

## I am talking about a _FURTHER CUSTOMISATION_ that is allowed - for ’ Headers ’ - within the _Standard page layout_ option ~ ’ _Header Scroll Settings’_

## Header \> Select \> Settings icon \> Header Scroll Settings \> (se to) Disappears

What the above setting does is ~

- **Disappears:** When you visitors scroll through your site, the header disappears. For the header to reappear, your visitors need to start scrolling up.

* * *

This ‘Scroll Effect’ is _otherwise_ working fine.

It’s an ‘ISSUE’ _only when I add the above-mentioned code_ to a Button - as mentioned in my original post…

### I have HIGHLIGHTED the issue below as " PROBLEM "

If you look at our [Homepage](https://www.babli.org/home?siteRevision=5155) (release candidate) - and _scroll down to the FOOTER_ - you will see TWO icons with upward pointing arrows (both are go to top links)…

_—\> NOTICE THAT THE HEADER GETS HIDDEN, WHEN YOU SCROOL DOWN - which is the effect of the_ _ **Disappears** _ _setting added to the Header Scroll Effect_

- If you click the LOWER icon - **black arrow pointing up** [I have added this arrow as a ‘test’ button, only for this release candidate] - This arrow-button is _LINKED_ to ‘Top of Page’ with the ‘Link’ option of the Icon.

In this case, the BASICS are _FINE -_ in the sense that …

1. The page jumps to the Top

2. The Header (hidden by the scroll down action) gets revealed -  
BUT, there is ANOTHER thing that happens - which is what I am trying to _AVOID …_

3. The page _scrolls up WITH ANIMATION -_ as opposed to, _JUMPING to the Top_ , without the whole page being ‘traversed’ in the course of the movement to the top (‘animation’)

- However, if you click the _UPPER_ icon - _ **white** _ **arrow pointing up & text saying ‘TOP’** [this is a icon + text Group] - This Button (Group) - [#shape31] is _ **NOT** _ _LINKED_ to anything with ‘Link’ options…

Instead, it is **‘linked’ to the Top of page** with the following _ **custom code** _ _added to the code panel_

[as shared in my original post] ~

```javascript
exportfunction shape31_click(event) {   
wixWindow.scrollTo(0, 0, {"scrollAnimation": false
};

```

### In this case, the ‘PROBLEM’ comes into play with POINT 2 - in the sense that …

1. NO PROBLEM - The page jumps to the Top

2. PROBLEM - The Header (hidden by the scroll down action) DOES NOT GET revealed - even after the page has ‘arrived’ (jumped) to the Top position

3. NO PROBLEM - The page scrolls up WITHOUT ANIMATION - that is, it JUMPS to the Top - as intended

Any suggestions/ guidance would be much appreciated.

Thanks in advance…

~ @Aaditto (For bablifarm)

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [February 19, 2021, 6:13pm UTC](https://forum.wixstudio.com/t/scrollto/16247/9 "2021-02-19T18:13:17Z")

</div>

Perhaps you can use something like this…  
[https://russian-dima.wixsite.com/meinewebsite/header](https://russian-dima.wixsite.com/meinewebsite/header)

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 23, 2021, 11:28am UTC](https://forum.wixstudio.com/t/scrollto/16247/10 "2021-02-23T11:28:44Z")

</div>

Thank you for responding @russian-dima …

I’ve been trying to adapt your code to solve my problem… but it’s not really working, so far!

As far as I can understand - the real ‘issue’ is arising from the ’ **Header Scroll Setting** ’ that is applied to my header… _clashing_ with the \<{“scrollAnimation”:false}\> part of my code.

* * *

There are four options - your code is partly _functional_ , depending on the CHOICE - as follows :-

’ **Header Scroll Setting** ’ Options ~

1. Scrolls with site ~

2. Your code works - **only with** viewport on **TOP of page -** when scrolled down , **your** _ **code works** _ _-_ but header items **can’t be seen**

3. **My code** _works_ - but the _original intention_ is lost - i.e. to hide the header on scrolling away form the top.

4. Freezes ~

5. Your code works - in **any** position

6. My code becomes _ **redundant** _

7. Disappears ~

8. Your code works - **only with** viewport on **TOP of page -** same as 1. above

9. **My code** _does not work_ - since the \< { “scrollAnimation” : **false** } \> part of my code _prevents_ the header from being displayed - I think!

10. Fades out ~

11. Your code works - same as 1. & 3. above

12. **My code** _does not work_ - same as 3. above

* * *

This is a [**dummy copy**](https://babli-farm.wixsite.com/website-1/home) of my site (homepage) with the DISAPPEAR option chosen for the Header Scroll Option (which is what I want)

If you play around with that page (link above), you’ll see ~

- Show/Hide buttons (frozen on left margin) - _YOUR CODE_

- Dark blue _Down Arrow_ - to take you to the bottom of the page - WIX _INBUILT_ LINK added to this

- When you reach the bottom of the page - _ROUND ICON with UP ARROW - MY CODE_

As you will see, the required effect is NOT BEING ACHIEVED…

* * *

This is a [**release-version copy**](https://babli-farm.wixsite.com/website-1/home?siteRevision=7) of the above site with the SCROLLS WITH SITE option chosen for the Header Scroll Option (which is NOT what I want)

### 

Here, _your-code_ buttons still _ **can’t** _ show the header, when viewport is not on _top of page_ - my button **works** - **but the original purpose has been lost!**

* * *

ANY POINTERS AS TO WHAT COULD BE DONE TO RECTIFY THE ISSUE WOULD BE OF GREAT HELP!

* * *

Another little thing about your code - which I’m a bit foggy about…

```javascript
export function button2_click2(event) {
show_Header()
}

```

Why is this a “click2” event?  
[Rather than just a “click” event…]

Apparently the the only onClick function of the button is showing the header, isn’t it?

What am I missing?

[Sorry if that’s a stupid question! I am a complete novice at coding - trying to learn the ropes as I go along, with a JavaScript for Dummies, and my hands on experiments here…]

Cheers!  
And thanks again…

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [February 24, 2021, 8:51am UTC](https://forum.wixstudio.com/t/scrollto/16247/11 "2021-02-24T08:51:46Z")

</div>

Ok, you are writing a lot of text to explain your issue. In the most of cases i would say —\> the more informations —\> the better it is.  
But in your case, there are already too much of informations.

You could also describe your issue in few sentences like…

What i want to achieve is…

1. …when click on a button or shape (element) i want to navigate to a custom screen-position.
2. …when the screen-position leaves a certain screenarea, or the “go-to-bottom-button” is clicked —\> the header should be closed.
3. …when reaching back a certain screen-area, or press on the “go-to-top-button”, the page should scroll back to top and the header should apear.
4. All action should be done without any scrolling animation.

Is this what you want to achieve???

If so, than take a look here onto this example…

[https://www.media-junkie.com/show-hide-header](https://www.media-junkie.com/show-hide-header)

To ahieve this function, you will need to place 2x-anchors onto your page.  
One of them —\> onto the very top of your Header.  
The second one → onto the very top of your page.

And of course some CODE…

```javascript
import wixWindow from 'wix-window';

$w.onReady(function () {
    $w('#iconButton1').onClick(()=>{
        wixWindow.scrollTo(0, 0, {"scrollAnimation": false}), show_Header();
    })
    
    $w('#iconButton2').onClick(()=>{
        wixWindow.scrollTo(0, 2100, {"scrollAnimation": false}), hide_Header();
    })
    $w('#anchor1').onViewportLeave(()=>{hide_Header()})
    $w('#anchor2').onViewportEnter(()=>{show_Header()})
});

function hide_Header() {$w("#header1").children.forEach((item, i) => {item.collapse();})}
function show_Header() {$w("#header1").children.forEach((item, i) => {item.expand();})}

```

Check it out and test the functionality of the example-page. 😉

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 25, 2021, 8:28am UTC](https://forum.wixstudio.com/t/scrollto/16247/12 "2021-02-25T08:28:29Z")

</div>

Thanks for your patience, @russian-dima …

I know, my descriptions are becoming really long!

That’s mostly because I have been trying to clarify to you (and J.D. before) - without much success till now - a point which, as far as I can tell, is _not_ about the _code_ .

Rather, I think, it is a clash between an _INBUILT FEATURE_ within the Wix Editor - which I am using/ want to continue using… and the _CUSTOM CODE_ that I am putting into the code panel.

**You write ~**  
What i want to achieve is…

1. …when click on a button or shape (element) i want to navigate to a custom screen-position.  
Ans:  
**YES** (go back to top of any page) - element is placed in the footer

2. …when the screen-position leaves a certain screen area, or the “go-to-bottom-button” is clicked —\> the header should be closed.  
Ans:  
**NO** (not exactly) -  
I want the header to be HIDDEN when the user scrolls down on any page, at any position on the page - and then the header should SHOW again when the user scrolls up .

_This_ is what the _INBUILT FEATURE_ mentioned above is achieving …

1. …when reaching back to a certain screen-area, or press on the “go-to-top-button”, the page should scroll back to top and the header should appear.  
Ans:  
**NO** - for the first part ( back to a certain screen-area ) ~  
YES - for the second part ( press on the “go-to-top-button” ) -

2. All action should be done without any scrolling animation.  
Ans:  
**ONLY** the ’ back-to-top ’ action should _NOT_ have any scroll animation.

When I try to use your custom code (s) _WITHOUT_ disabling the ‘Header Scroll Setting’ - THE CODE DOES NOT WORK ~ as you can see here…

[https://babli-farm.wixsite.com/test/home](https://babli-farm.wixsite.com/test/home)

As far as I can understand -  
The way to make the (go to top - without animation - on click of an element) code work is…

1. To set the ’ Header Scroll Effect ’ setting to ’ None ’ - and then

2. WRITE CUSTOM CODE to achieve the " _Disappears_ " effect on the header as well…

So, (a code equivalent of) something like this, if you can suggest ~

window \> on scroll DOWN \> header1 \> hide  
window \> on scroll UP \> header1 \> show

Is that even possible?

Thanks again…

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [February 25, 2021, 9:41am UTC](https://forum.wixstudio.com/t/scrollto/16247/13 "2021-02-25T09:41:16Z")

</div>

Ok, now i am confused 🙄🤣  
Please take a look one more time at my example. This time i did not hide my header at all, that means —\> the header is right from the beginning VISIBLE.

My header is this PART of my site…(HEADER).

 ![](https://us1.discourse-cdn.com/wix/original/3X/0/2/0248af6d0da844bdd6a01530209ca00b4bc29792.png)

Your request …

> window \> on scroll DOWN \> header1 \> hide

> window \> on scroll UP \> header1 \> show  
> Now, when you try to scroll down, the header normaly should disappear (right from the beginning).  
> And when you scrolled up to back to the top, the header normaly should appear again automaticaly when you reach the very top of your site.

Or do you want to let the HEADER immediately appear, while you are scrolling up ?

[https://www.media-junkie.com/show-hide-header](https://www.media-junkie.com/show-hide-header)

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 25, 2021, 3:34pm UTC](https://forum.wixstudio.com/t/scrollto/16247/14 "2021-02-25T15:34:42Z")

</div>

“Or do you want to let the HEADER immediately appear, while you are scrolling up ?”

Yes, exactly.

It should _appear_ (anywhere on the page) - when user scrolls UP - and _disappear_ (anywhere on the page) - when user scrolls DOWN

And that’s exactly what the Wix Editor \> ‘Header Scroll Setting’ \> ‘Disappear’ setting _IS ALREADY DOING -_ ( [HERE](https://babli-farm.wixsite.com/test/home) ).

If you go to that link and scroll down and up on the page (with mouse wheel/ keyboard) - you will see the effect working.

But the minute my BUTTON (with custom code) is clicked - the header refuses to show…

That’s why I was thinking, if I can _create_ that same scroll-effect for the header - _instead of_ using the Wix Setting - then, maybe  
both the scroll-effect for header, as well as the jump to top _without_ animation, would work?!

That’s why I though if the following was possible with code…  
window \> on scroll DOWN \> header1 \> hide  
window \> on scroll UP \> header1 \> show

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [February 26, 2021, 12:10am UTC](https://forum.wixstudio.com/t/scrollto/16247/15 "2021-02-26T00:10:48Z")

</div>

```javascript
var scrollDirection
var scrollPosition = 0
var scrollInterval = 500 //The lower the scrollInterval, the more precise will be the scroll-position.

$w.onReady(function () {
    setInterval(show_scrollPosition(), scrollInterval);
})
function show_scrollPosition() { 
    wixWindow.getBoundingRect()
    .then((windowSizeInfo) => {
 let scrollX = windowSizeInfo.scroll.x; // 0
 let scrollY = windowSizeInfo.scroll.y; // 120
    console.log(scrollX, scrollY)
 if (scrollPosition !== windowSizeInfo.scroll.y) {
 if (scrollPosition < windowSizeInfo.scroll.y) {scrollDirection = "DOWN", console.log(scrollDirection)}
 else if (scrollPosition > windowSizeInfo.scroll.y) {scrollDirection = "UP", console.log(scrollDirection)}
            scrollPosition = windowSizeInfo.scroll.y;
        }
    });
}

```

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 26, 2021, 11:04am UTC](https://forum.wixstudio.com/t/scrollto/16247/16 "2021-02-26T11:04:23Z")

</div>

Wow! Thanks for all the time and effort you are spending on this @russian-dima !!!

Can’t say I understand every part of that last code you posted…

But, from what I can make out, this code ‘sets up a function’ which tells the browser (?) whether the page is scrolling ‘UP’/‘DOWN’, at any given point of time while the user is navigating the page??

If I’ve got that right - then, there will have to be _another code_ which _‘calls’_ this _function_ and SHOWS/HIDES the header depending on which direction the page is moving - right?

Also, (assuming I have understood the logic correctly up to this point)… this code, _as well as the other code_ ( I have no idea what that should be !) will go into the ’ masterPage.js ’ part of the code panel - so that it works for _any_ page of the site - correct?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [February 26, 2021, 7:16pm UTC](https://forum.wixstudio.com/t/scrollto/16247/17 "2021-02-26T19:16:41Z")

</div>

This Code not just shows the direction, it also shows the exact position while scrolling

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [February 27, 2021, 7:34am UTC](https://forum.wixstudio.com/t/scrollto/16247/18 "2021-02-27T07:34:51Z")

</div>

So, how do I call this code (function?) to make the header _disappear_ when scrolling DOWN - and _appear_ again whenever page is scrolled UP… ?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [February 27, 2021, 9:25am UTC](https://forum.wixstudio.com/t/scrollto/16247/19 "2021-02-27T09:25:24Z")

</div>

Did you take a look onto CONSOLE?  
Scroll up and down and see what happens in the CONSOLE.  
Which results do you get?

Then set the scrollIntervall to 100 and do it again.  
Then set the scrollInterval to 50 and do it again.  
Then set the scrollInterval to 25 and do it again.

Now you should recognize how it works.

---

<div class="post-metadata">

**Author:** ![bablifarm](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bablifarm/32/14510_2.png) [@bablifarm](https://forum.wixstudio.com/u/bablifarm)\
**Post date:** [March 3, 2021, 11:37am UTC](https://forum.wixstudio.com/t/scrollto/16247/20 "2021-03-03T11:37:21Z")

</div>

Sorry for the delay in providing the feedback you asked for @russian-dima …

I’m not sure what you mean by “CONSOLE”…

(A) Wix Editor \> Preview \> “Developer Console”?  
(B) Google Chrome (Browser) \> Published Site \> Inspect \> Console?

With (A)…

- The Developer Console loads with displaying the x & y position where I was on the Editor, at the point of loading + the word “DOWN” _only if_ the y-position is NOT zero (Image 1 below)

- If I go into preview with page at x=0 y=0 - then, the Developer Console _only_ shows “0 0” (Image 2 below)

- Nothing happens when I scroll up/down…  
Image 1

 ![](https://us1.discourse-cdn.com/wix/original/3X/b/e/be76501ce9b068e194a159cef4a650cd7d1f0962.jpeg)

Image 2

 ![](https://us1.discourse-cdn.com/wix/original/3X/a/6/a6bc6a00eb15f515cd63859e5db60d166dd5ac5b.jpeg)

With (B)…

- The Console tab shows _lots_ of ERRORS (“4 errors” in red + “6 warnings” in yellow… (+User messages… Info etc…)

- There _is_ one line - saying “console.js:35” on the right margin - where it is displaying “0 0” - which I am guessing is the x=0 & y=0 values when the page loads

- When I scroll up/down… _MORE_ warnings appear, below the “0 0” line (Image 3 below)…  
These warnings read -

```javascript
"DevTools failed to load SourceMap: Could not load content for https://static.parastorage.com/services/wix-ui-santa/1.1539.0/wixcode/wixcode-components.bundle.min.js.map: Fetch through target failed: Target not supported; Fallback: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE"

```

Image 3

 ![](https://us1.discourse-cdn.com/wix/original/3X/9/1/91aacc400712c6274710f2d811b6e38817fe621d.jpeg)

[Next page](https://forum.wixstudio.com/t/scrollto/16247.md?page=2)
