georad commited on
Commit
11b9e87
·
verified ·
1 Parent(s): 8a08c1a

Update pages/home.py

Browse files
Files changed (1) hide show
  1. pages/home.py +6 -3
pages/home.py CHANGED
@@ -52,13 +52,16 @@ st.header("Tags the below 41 medical entities")
52
  for i in range(100):
53
  st.write(f"This is scrollable content line {i}")
54
 
55
- # Add JavaScript to automatically scroll to the bottom
 
 
 
56
  st.markdown("""
57
  <script>
58
  // Set a timeout to ensure the page has loaded
59
  setTimeout(function() {
60
- // Get the window object and scroll to the bottom
61
- window.scrollTo(0, document.body.scrollHeight);
62
  }, 500);
63
  </script>
64
  """, unsafe_allow_html=True)
 
52
  for i in range(100):
53
  st.write(f"This is scrollable content line {i}")
54
 
55
+ # Create an anchor at the bottom
56
+ st.markdown('<div id="bottom"></div>', unsafe_allow_html=True)
57
+
58
+ # Add JavaScript to automatically scroll to the anchor
59
  st.markdown("""
60
  <script>
61
  // Set a timeout to ensure the page has loaded
62
  setTimeout(function() {
63
+ // Scroll to the bottom anchor
64
+ document.getElementById('bottom').scrollIntoView();
65
  }, 500);
66
  </script>
67
  """, unsafe_allow_html=True)