Rimil Dey Rimil Dey - 1 year ago 95
HTML Question

Load the page at index.html after every refresh

I am using the fullPage.js plugin to scroll page by page. The plugin is using hash urls to do so. On page refresh, the document is always loading on the last hash url it was on. How to make the document load at the top after every refresh? I tried adding the following code but it did not work out:


This is the link to the webpage - https://rimildeyjsr.github.io/St.Anthony-Website

jQuery :

$('#fullpage #section1').hide();
$('#fullpage #section1').show();
afterLoad : function(anchorLink,index) {
if (index == 2 || anchorLink == 'Page2'){
$('.school-name').addClass('animated slideInUp').css('visibility','visible');


Link to github repository : https://github.com/rimildeyjsr/St.Anthony-Website

Answer Source

It looks like this on your page causes it to go back to the top.

window.location.hash = '#Page1';

So you could try doing that

$(window).on('load', function() {
    window.location.hash = '#Page1';

which should happen any time you load the page, including refreshing.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download