- Im trying to scroll the page to an anchor when the page is loaded, but I don´t know why it is not working?
I have an anchor down the page that Im loading.
And then in my js page I have this.
$$(document).on('page:init', '.page[data-name="diagram"]', function (e) {
var page = e.detail;
$$(page.el).on("click",".sokstatistik", function() {
statistikmanaden = $$(page.el).find('input[name=statistikmanad]').val()
console.log(statistikmanaden)
mainView.router.navigate("/diagram/?statistikmanad="+statistikmanaden, {ignoreCache: true,reloadCurrent:true, force:true});
setTimeout(function(){
window.location.hash='#id1';
},1000);
});
});
Or how can I scroll-go to an anchor? Thanks!
- I also tested to put a link on the page to be able to scroll to an anchor but I can´t get that to work as well?
<a href="#goto" class="sliding-link">Link to div</a> lots of text... <div id="goto">I'm the div</div>
Why isn´t this working?
Thanks again.