Created
          February 16, 2015 12:12 
        
      - 
      
 - 
        
Save Jursdotme/de3c898b08e0d76d0407 to your computer and use it in GitHub Desktop.  
    Automatic fitvids
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $(document).ready(function(){ | |
| $('iframe[src*="youtube"]').wrap( "<div class='thing-with-video'></div>" ); | |
| $('iframe[src*="vimeo"]').wrap( "<div class='thing-with-video'></div>" ); | |
| // Target your .container, .wrapper, .post, etc. | |
| $(".thing-with-video").fitVids(); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment