georad commited on
Commit
02ac1f8
·
verified ·
1 Parent(s): 5c7db51

Update pages/home.py

Browse files
Files changed (1) hide show
  1. pages/home.py +13 -16
pages/home.py CHANGED
@@ -49,20 +49,17 @@ st.header("Tags the below 41 medical entities")
49
  'WEIGHT'
50
 
51
 
52
- # This is the key trick:
53
- # 1. Define all content first
54
- content = [f"This is scrollable content line {i}" for i in range(100)]
55
 
56
- # 2. Display first part of content
57
- for i in range(len(content) - 1):
58
- st.write(content[i])
59
-
60
- # 3. Add a placeholder for the last item
61
- last_item = st.empty()
62
-
63
- # 4. Show "Bottom Reached!" message to confirm we're at the bottom
64
- st.success("Bottom of page reached!")
65
-
66
- # 5. Finally, add the last content item
67
- # This forces Streamlit to render the page up to the bottom
68
- last_item.write(content[-1])
 
49
  'WEIGHT'
50
 
51
 
52
+ # Create scrollable content
53
+ for i in range(100):
54
+ st.write(f"This is scrollable content line {i}")
55
 
56
+ # Add JavaScript to automatically scroll to the bottom
57
+ st.markdown("""
58
+ <script>
59
+ // Set a timeout to ensure the page has loaded
60
+ setTimeout(function() {
61
+ // Get the window object and scroll to the bottom
62
+ window.scrollTo(0, document.body.scrollHeight);
63
+ }, 500);
64
+ </script>
65
+ """, unsafe_allow_html=True)