WebSite X5Help Center

 
Adrian B.
Adrian B.
User

Keep Header Always Visible While Scrolling  en

Autore: Adrian B.
Visite 2796, Followers 3, Condiviso 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

Postato il
13 RISPOSTE
Esahc ..
Esahc ..
Moderator

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

Leggi di più
Postato il da Esahc ..
Adrian B.
Adrian B.
User
Autore

Yup that works, thank you

Leggi di più
Postato il da Adrian B.
Adrian B.
Adrian B.
User
Autore

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

Leggi di più
Postato il da 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

.

Leggi di più
Postato il da  ‪ KolAsim ‪ ‪
Adrian B.
Adrian B.
User
Autore

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

Adrian

Leggi di più
Postato il da 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

.

Leggi di più
Postato il da  ‪ KolAsim ‪ ‪
Adrian B.
Adrian B.
User
Autore

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

Leggi di più
Postato il da Adrian B.
Esse Di
Esse Di
User

That does work for me

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

Leggi di più
Postato il da Esse Di
Adrian B.
Adrian B.
User
Autore

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

Adrian

Leggi di più
Postato il da Adrian B.
Adrian B.
Adrian B.
User
Autore

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

Leggi di più
Postato il da 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.

Leggi di più
Postato il da 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 ...

.

Leggi di più
Postato il da  ‪ 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.

Leggi di più
Postato il da John S.