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

chore: another attemp

Browse files
Files changed (1) hide show
  1. app.py +13 -22
app.py CHANGED
@@ -537,27 +537,18 @@ CSS = """
537
 
538
  """
539
  back_to_top_btn_html = '''
540
- <button id="toTopBtn" onclick="'parentIFrame' in window ? window.parentIFrame.scrollTo({top: 0, behavior:'smooth'}) : window.scrollTo({ top: 0 })">
541
- <a style="color:white; text-decoration:none;">Back to Top!</a>
542
- </button>'''
543
-
544
- style="""
545
- #toTopBtn {
546
- position: fixed;
547
- bottom: 10px;
548
- float: right;
549
- right: 18.5%;
550
- left: 77.25%;
551
- height: 30px;
552
- max-width: 100px;
553
- width: 100%;
554
- font-size: 12px;
555
- border-color: rgba(217,24,120, .5);
556
- background-color: rgba(35,153,249,.5);
557
- padding: .5px;
558
- border-radius: 4px;
559
- }
560
- """
561
 
562
  if __name__ == "__main__":
563
 
@@ -567,7 +558,7 @@ if __name__ == "__main__":
567
 
568
  (X_train, X_test), (y_train, y_test), valid_symptoms, diseases = load_data()
569
 
570
- with gr.Blocks(css=style) as demo:
571
  gr.HTML(back_to_top_btn_html)
572
 
573
  # Link + images
 
537
 
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__":
554
 
 
558
 
559
  (X_train, X_test), (y_train, y_test), valid_symptoms, diseases = load_data()
560
 
561
+ with gr.Blocks(css=CSS) as demo:
562
  gr.HTML(back_to_top_btn_html)
563
 
564
  # Link + images