georad commited on
Commit
6a93f0a
·
verified ·
1 Parent(s): eaae769

Update pages/home.py

Browse files
Files changed (1) hide show
  1. pages/home.py +18 -8
pages/home.py CHANGED
@@ -22,23 +22,33 @@ entities = [
22
  ]
23
 
24
  for entity in entities:
25
- st.write(entity)
26
-
27
  # Create scrollable content
28
  for i in range(100):
29
  st.write(f"This is scrollable content line {i}")
30
 
31
- # JavaScript to scroll to the bottom
32
- scroll_script = """
33
  <script>
34
- var body = window.parent.document.querySelector(".main");
35
- body.scrollTop = body.scrollHeight;
 
 
 
 
 
 
 
 
 
 
 
36
  </script>
37
  """
38
 
39
  # Inject the JavaScript
40
- components.html(scroll_script, height=0, width=0)
41
-
42
 
43
  '''
44
  st.title("📘Named Entity Recognition")
 
22
  ]
23
 
24
  for entity in entities:
25
+ st.write(entity)
26
+
27
  # Create scrollable content
28
  for i in range(100):
29
  st.write(f"This is scrollable content line {i}")
30
 
31
+ # JavaScript to scroll to the bottom - Targeting body or html
32
+ scroll_script_body = """
33
  <script>
34
+ function scrollToBottom() {
35
+ const body = window.parent.document.body;
36
+ const html = window.parent.document.documentElement;
37
+ // Scroll the body or html element
38
+ if (body) {
39
+ body.scrollTop = body.scrollHeight;
40
+ }
41
+ if (html) {
42
+ html.scrollTop = html.scrollHeight;
43
+ }
44
+ }
45
+ // Run the scroll function after a small delay to allow content to render
46
+ setTimeout(scrollToBottom, 100); // Adjust delay if needed
47
  </script>
48
  """
49
 
50
  # Inject the JavaScript
51
+ components.html(scroll_script_body, height=0, width=0)
 
52
 
53
  '''
54
  st.title("📘Named Entity Recognition")