0

what I want to do; I don't want the user to come back from the page they went to when they clicked on a link. i.e. the back button should be completely disabled. I will put the exit button for the page that should go later. I tried window.location.replace but it didn't work

if you can go to the page from this link to understand what i want to do https://awenarts.com/wer

Click on the news and click on any link on the page you go to. (arrow shape) What can I do to avoid returning to this page, namely disabling browser navigation completely.

href

<a href="javascript:delay('pages/news-style-1/news.html')" >

function that works when clicked

function delay (URL) {
    
    setTimeout( function() {
        window.location = URL
    }, 1000);   
    
    var deneme = body.getBoundingClientRect().bottom * -1;  
    tPage.classList.add('transition-close');
    body.classList.add('stop-scroll');  
    tPage.style.display = "block";
    tPage.style.top = deneme + "px";        
}

current

how can I do that

manekko
  • 5
  • 5
  • A far better strategy would be to use History pushState and popState, allow the history (!!!) and instead of navigating (refreshing the page) - simply animate to the desired page content. The page you linked has no means of sharing i.e: example.com/news and landing on the news section which is really a shame. – Roko C. Buljan Jan 01 '23 at 19:36
  • Check this thread: https://stackoverflow.com/questions/12381563/how-can-i-stop-the-browser-back-button-using-javascript – TheSmith1222 Jan 01 '23 at 19:56

0 Answers0