A smooth scroll back to top?

6 years 4 months ago - 6 years 4 months ago #809 by tiwi
A smooth scroll back to top? was created by tiwi
Is it possible in the coldzero template to set the back to top link to a smooth scroll?

As it is now it does not scroll and puts #top behind the page url. I was hoping to have the back to top option so it would not add #top behind the url and it would simply scroll smootly to the top of the page.

Please Log in to join the conversation.

6 years 4 months ago #811 by Adminv
Replied by Adminv on topic A smooth scroll back to top?
Hi!
Thanks for your suggestion.

I add a smoothscroll script to the new ColdZero version (1.0.1)
I test and check several scripts but I decide to use a HTML based (with a unique HTML #top identifier).
It is more flexible than a pure JS based version.

You just need to add a unique ID to a HTML element (like a DIV, span, p whatever)like:
<div id="#this_is_a_hook"> content </div>

and a link to it like:
<a href="#this_is_a_hook">Scroll</a>

to use it.
It makes it very easy to integrate several scrolling links and hooks without touching the JS. So you can build easily a one page layout without JS knowlege just by adding some ID´s to HTML elements and links to it in your modules, articles, menus etc.

Please Log in to join the conversation.

6 years 4 months ago #813 by tiwi
Replied by tiwi on topic A smooth scroll back to top?
Thanks, it still gives /#to_the_top behind the url. Can you not navigate on the page and keep clean url?

Please Log in to join the conversation.

6 years 4 months ago #814 by Adminv
Replied by Adminv on topic A smooth scroll back to top?
Hi!

Please read my post above.
It is possible via JS but not as flexible as the HTML solution.
The HTML solution gives you the ability to add links and hooks everywhere in your modules, articles etc. without touching the JS code.
Means everyone can use the smoothscroll script easily and for nearly any purpose, not just for scoll to the top.

Please Log in to join the conversation.

Time to create page: 0.134 seconds
Powered by Kunena Forum
Don't have an account yet? Register Now!

Sign in to your account