WebSite X5Help Center

 
Adrian B.
Adrian B.
User

Keep Header Always Visible While Scrolling  en

Auteur : Adrian B.
Visité 441, Followers 3, Partagé 0  

Is there a simple way to keep the Header (Template) always visible, so when the user scrolls down a page the header always remains at the top and visible?

Thank you

Adrian

Posté le
13 RéPONSES
Esahc ..
Esahc ..
Moderator

Sticky Bar, get the header exactly as you want and then copy all objects to the sticky Bar.

Lire plus
Posté le de Esahc ..
Adrian B.
Adrian B.
User
Auteur

Yup that works, thank you

Lire plus
Posté le de Adrian B.
Adrian B.
Adrian B.
User
Auteur

Well, I thought it was the answer - so as you scroll down, the header starts to roll up out of sight, and then the sticky (duplicate of the header) suddenly drops down and blocks part of the content of the top of the page......

Any other way to "freeze" the header while the page content scrolls?

Adrian

Lire plus
Posté le de Adrian B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Adrian B.
... ... Any other way to "freeze" the header while the page content scrolls? ... ... 

(It > En)  ... ... you could use simple EXTRA code ...
... it depends on how the page is structured ...
... you post the link without applying the stickbarr, so that I can evaluate ...
... for example, if the menu were inside the HEADER, this code could be sufficient in / HEAD:
<style> #imHeader {position:fixed;} </style>

.

ciao

.

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Adrian B.
Adrian B.
User
Auteur

Are you asking for the site url? abthermal.com - i have disabled the sticky.

Adrian

Lire plus
Posté le de Adrian B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Adrian B.
Are you asking for the site url? abthermal.com - i have disabled the sticky. Adrian

>> Step 1 - Settings > The Advanced section > Statistics, SEO and Code > Options in the Code section | Custom Code: > ▼Before closing the HEAD tag:

......................code..............................

<style> #imHeaderObjects {position: fixed;margin:auto} </style>

....................................................

.

ciao wink

.

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Adrian B.
Adrian B.
User
Auteur

That worked way better thank you. But now the issue appears to be foreground/background of both the header objects and page objects. Will have to play with it and see if I can get it to look good.

Thank you, Adrian

Lire plus
Posté le de Adrian B.
Esse Di
Esse Di
User

That does work for me

<style> #imHeader {position: sticky; top: 0; z-index: 10000;} </style>

Lire plus
Posté le de Esse Di
Adrian B.
Adrian B.
User
Auteur

That does work perfect, no further issues that I can see. Thank you very much!

Adrian

Lire plus
Posté le de Adrian B.
Adrian B.
Adrian B.
User
Auteur

Detected an issue.... the Internal Page Anchors do not respect the frozen header; top of the anchor area goes to the top of the page behind the header....

Adrian

Lire plus
Posté le de Adrian B.
John S.
John S.
User

This is a well-known problem. You could make a dummy-object just above the wanted anchor. The dummy-object should have the same height as the frozen header, and then the dummy-object should be target for the anchor. This way the wanted object will be exactly beneath the frozen header.

Or you could make the anchors "yourself" as div's and then give them an offset the same as the height of the frozen header.

Lire plus
Posté le de John S.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Adrian B.
Detected an issue.... the Internal Page Anchors do not respect the frozen header; top of the anchor area goes to the top of the page behind the header.... Adrian

(It > En) ... could be simple with CSS ...
... post the link of the page with the anchors you are interested in, in order to evaluate ...

.

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
John S.
John S.
User

Hello Adrian

I have reloaded an "old" example here : http://eksempelsite.dk/adhoctest/brm09/side-22.html

The example shows the use of offset using the h3. The example/method is very adaptive - if not enough space, then the "anchors" is stacked.

Try click on "Ansgar Kirke", "Blok2" or "Blok3" and you will see the anchor in function. I removed the underlining for the clickable text, as it did not look good.

How it is made can be seen in the downloadable PDF. It is quite simple - once you have used it.

I will let it stay for a while, and then it will be removed. ( the "goto" links will not function as it is not the original files ). It is just made for the example.

Lire plus
Posté le de John S.