I am trying to add a back-to-top button to the bottom of my topics using a custom toolbar button and javascript. I already tried all kind of solutions that have been mentioned in the forum but nothing works in our help.
We are using:
- HTML5 output
- side navigation
What I've tried so far:
1. Adding a custom toolbar button.
2. Adding the javascript code in the 'Setup' tab of the skin for the button:
Code: Select all
function scrollBackToTop(){
alert("hallo");
window.scrollTo(0,0);
};
Problem:
When I click on the button in my generated help nothing happens. I tested if the script is called with an alert method and this works. However it seems as if the scrollTo method is not recognized/known.
I also tried several other javascript calls instead of 'window.scrollTo(0,0)' but without any effect.
I assumed that the jquery lib that is included by default from Flare (<script src="../Resources/Scripts/jquery.js"></script>) does not know the scrolling methods. Therefore, I added a link to the jquery lib 'jquery-3.3.1.min.js' to my master page:
Code: Select all
<script src="../Scripts/jquery-3.3.1.min.js"></script>
- the position of the header is not fixed anymore. If I scroll down, the header moves up.
- the TOC is not displayed anymore. Only the background is visible.
Probably, the 'default' jquery file from Flare conflicts with the additionally included jquery-3.3.1.min.js file?? So what can I do to make this work?? I am no javascript pro and don't know what else I can try to fix this
Others seem to have a working solution but I don't get which javascript code I have to use that also works with the side navigation and the default jquery lib included by Flare.
Anybody any idea??