0 Replies Latest reply on Sep 2, 2015 1:25 PM by dansteinsaatchi

    How to link to anchor inside scroll box?

    dansteinsaatchi

      I am creating a banner which has a large chunk of text inside a scrollbox. Somewhere near the end of that chunk of text is a paragraph with an anchor link.

      Elsewhere in the banner I have a button. When that button is clicked, I would like the content of the scroll box to scroll (or jump) to the anchor link.

       

      I was able to place the following code onto my button:

       

      Symbol.bindElementAction(compId, symbolName, "${terms_text}", "click", function(sym, e) {      

               window.open("#tc","_self");

      });

       

      This works, but with the following problem - if I click my button as soon as the banner loads, the entire scroll box jumps up to the top of the banner. Once my banner animations begin, the box moves back to it's proper location, and from then on clicking the button works as expected.

       

      Why is the scrollbox jumping to the top of the banner like that, and how do I prevent it?