jQuery toggleClass example

Toggle class name on click in jQuery

by Simon Price

HTML

<div class="video-container"> 
        
            <div class="iframe_block">  	
            
            <iframe style="display :block" id="dayone" src="https://iishf.sportngin.com/schedule/day/league_instance/191442/2023/4/28?subseason=870949" class="iframe_class" width="940px" scrolling="yes">Ваш браузер не поддерживает iframe!</iframe>  
        
            <style>
        
            .iframe_block { 
            overflow: hidden; 
            width: 2340px; /* Ширина окна */ 
            height: 1080px; /* Высота окна */ 
            
            }  	.iframe_class { 	
            border: 1px; 
            margin-left: 0px; /* Потрезать слева */
            margin-top: -138px; /* отрезать сверху  */ 	
            margin-bottom: 50px; /* отрезать снизу */ 	
                }
            </style>  
            </div>  
        
            </div> 
            <style> .video-container { position:relative; padding-bottom:250%; padding-top:30px; height:0; overflow:hidden; } .video-container iframe, .video-container object, .video-container embed { position:absolute; top:0; left:0; width:100%; height:100%; } 
            </style>

            <div id="table">

            </div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#banner-message {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  font-size: 25px;
  text-align: center;
  transition: all 0.2s;
  margin: 0 auto;
  width: 300px;
}

button {
  background: #0084ff;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 15px;
  color: #fff;
}

#banner-message.alt {
  background: #0084ff;
  color: #fff;
  margin-top: 40px;
  width: 200px;
}

#banner-message.alt button {
  background: #fff;
  color: #000;
}

JavaScript

$(document).ready(function() {
            
                $('#dayone').on('load', () => {
                    console.log('iframe is completely loaded');
                    var content = document.getElementById('dayone').contentWindow.document.body.innerHTML
                    console.log(content);
})              
            })