Jump to content
Server Maintenance This Week. ×

Keep scroll position after refresh of page


This topic is 3824 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have sections that hide/show after clicking on an HTML tag of each section. The sections hide/show thanks to JavaScript code.

 

The problem is after the user click on the tag and the section below shows/hides, the page refreshes and the scroll goes to the top of the page. I want the scroll to remains where it was before the user click.

 

I added a few lines of JS

<script type="text/javascript">             
function refreshPage () {    
      var page_y = document.getElementsByTagName("body")[0].scrollTop;  
      window.location.href = window.location.href.split('?')[0] + '?page_y=' + page_y; 
	  }           
</script> 

This code works in a HTML document opened in a browser (Chrome/Firefox/IE), but it doesn't work in Filemaker.

 

Do you have any ideas?

Link to comment
Share on other sites

This topic is 3824 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.