0

I'm using doxygen 1.8.14 to generate document in .html from my C++ source code.

I'm having a problem in my document only with google chrome, all other web browsers (FireFox, Opera, Edge,...) are working fine. In (doxygen-generated) PageA.html. I have seveal topics tagged with "#", like:

# Topic 1 # {#tag_topic1}
Very lengthy text ...
# Topic 2 # {#tag_topic2}
Very lengthy text ...
# Topic 3 # {#tag_topic3}
Very lengthy text ...

In (doxygen-generated) PageB.html, I have several links point to those topics defined in PageA.html

Refer to [topic 1](PageA.html#tag_topic1) ...
Refer to [topic 2](PageA.html#tag_topic2) ...
Refer to [topic 3](PageA.html#tag_topic3) ...

When I open PageB.html in google chrome browser and click the links, the page navigates to PageA.html but does not scroll to the destination topic tagged with "#", it only gives a very quick flashing. When test it in all other web browsers, it opens the PageA.html and then smoothly scrolls to the desintation topic and also make a short "glowing effect" on the topic text.

How can I fix this problem for google chrome? Appreciate it for any suggestions, thanks.

4
  • You wrote you are using 1.8.4 is this a typo? When not please try version 1.8.14. Commented Jan 26, 2018 at 18:12
  • Sorry, it is a typo, I'm using 1.8.14. Commented Jan 27, 2018 at 4:28
  • Googled for: chrome scroll to tag in page and got (a.o.) stackoverflow.com/questions/38588346/… maybe this gives a clue (I didn't test), you probably have to overrule the standard doxygen header (see documentation HTML_HEADER). Commented Jan 27, 2018 at 9:16
  • Thank you albert, it worked for me! You have solved a headache for me.:-) Commented Jan 29, 2018 at 15:54

1 Answer 1

0

Upon another developer's suggestion, I have solved the problem by adding the following code on every pages, which fixes the Chrome's scrolling problem. The original code is in this link.

$(document).ready(function () {
        var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
        if (window.location.hash && isChrome) {
            setTimeout(function () {
                var hash = window.location.hash;
                window.location.hash = "";
                window.location.hash = hash;
            }, 300);
        }
    });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.