kcelia commited on
Commit
2771500
1 Parent(s): 4ef6998

chore: another attemp

Browse files
Files changed (1) hide show
  1. app.py +15 -6
app.py CHANGED
@@ -538,16 +538,25 @@ CSS = """
538
  """
539
  back_to_top_btn_html = '''
540
 
541
- <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.min.js"></script>
542
- <iframe id="myIframe" src="iframe.html" style="width:1px;min-width:100%;" frameborder="0" scrolling="no"></iframe>
 
 
 
 
543
 
544
  <script>
545
- iFrameResize({ log: false }, '#myIframe')
 
 
 
 
 
 
 
 
546
  </script>
547
 
548
- <button id="toTopBtn" onclick="window.parent.postMessage('scrollToTop', '*')">
549
- <a style="color:white; text-decoration:none;">Back to Top!</a>
550
- </button>
551
  '''
552
 
553
  if __name__ == "__main__":
 
538
  """
539
  back_to_top_btn_html = '''
540
 
541
+ <button onclick="scrollToTop()">Scroll to Top</button>
542
+ <button onclick="scrollToBottom()">Scroll to Bottom</button>
543
+
544
+ <div id="content">
545
+ <!-- Content goes here -->
546
+ </div>
547
 
548
  <script>
549
+ function scrollToTop() {
550
+ const element = document.getElementById("content");
551
+ element.scrollIntoView(true);
552
+ }
553
+
554
+ function scrollToBottom() {
555
+ const element = document.getElementById("content");
556
+ element.scrollIntoView(false);
557
+ }
558
  </script>
559
 
 
 
 
560
  '''
561
 
562
  if __name__ == "__main__":