kcelia commited on
Commit
14091f6
·
unverified ·
1 Parent(s): 1a39ca4

chore: another attemp

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -542,15 +542,12 @@ back_to_top_btn_html = """
542
  </button>
543
 
544
  <script>
545
- function scrollToTop() {
546
- if ('parentIFrame' in window) {
547
- var iframe = window.parentIFrame;
548
- var element = document.getElementById('toTopBtn');
549
- iframe.moveToAnchor('toTopBtn', element);
550
- } else {
551
- window.scroll({ top: 0, behavior: 'smooth' });
552
- }
553
  }
 
554
  </script>
555
 
556
  """
 
542
  </button>
543
 
544
  <script>
545
+ window.addEventListener('message', function(event) {
546
+ if (event.data === 'scrollToTop') {
547
+ var iframe = document.getElementById('your-iframe-id'); // replace with your iframe's id
548
+ iframe.scrollIntoView(true);
 
 
 
 
549
  }
550
+ });
551
  </script>
552
 
553
  """