Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Hello guys,

 

I want to jump to a specific object when pushing a button.

When I export the InDesign file to html5 with In5 and ´leave the page format at Continous scroll I can jump an object using the follwing line:

$('html, body').scrollTop($("#item7456").offset().top, 2000);

When I set the page format to slider this line does not work anymore.

Can you give a hind for a workaround.

 

Thanks,

Stephan
in how_to by (260 points)
  

1 Answer

0 votes
 
Best answer

Hi Stephen,

With the Slider, you need to use the navigation of the Slider to get to the page first. Your code would need to look more like this:

var parentPageIndex = $("#item7456").parents('.page').index();
$(document).one('newPage', function(){
    $('html, body').scrollTop($("#item7456").offset().top, 2000);
});
nav.to(parentPageIndex);

by (197k points)
selected by
Thanks again Justin! You are the man!