
þÿ / /   F i n d   a l l   Y o u T u b e   v i d e o s  v a r   $ a l l V i d e o s   =   $ ( " i f r a m e [ s r c ^ = ' / / w w w . y o u t u b e . c o m ' ] " ) ,  
 / /   T h e   e l e m e n t   t h a t   i s   f l u i d   w i d t h          $ f l u i d E l   =   $ ( " b o d y " ) ;  
 / /   F i g u r e   o u t   a n d   s a v e   a s p e c t   r a t i o   f o r   e a c h   v i d e o  $ a l l V i d e o s . e a c h ( f u n c t i o n ( )   {  
 $ ( t h i s )          . d a t a ( ' a s p e c t R a t i o ' ,   t h i s . h e i g h t   /   t h i s . w i d t h )  
 / /   a n d   r e m o v e   t h e   h a r d   c o d e d   w i d t h / h e i g h t          . r e m o v e A t t r ( ' h e i g h t ' )          . r e m o v e A t t r ( ' w i d t h ' ) ;  
 } ) ;  
 / /   W h e n   t h e   w i n d o w   i s   r e s i z e d  $ ( w i n d o w ) . r e s i z e ( f u n c t i o n ( )   {  
 v a r   n e w W i d t h   =   $ f l u i d E l . w i d t h ( ) ;  
 / /   R e s i z e   a l l   v i d e o s   a c c o r d i n g   t o   t h e i r   o w n   a s p e c t   r a t i o      $ a l l V i d e o s . e a c h ( f u n c t i o n ( )   {  
 v a r   $ e l   =   $ ( t h i s ) ;          $ e l              . w i d t h ( n e w W i d t h )              . h e i g h t ( n e w W i d t h   *   $ e l . d a t a ( ' a s p e c t R a t i o ' ) ) ;  
 } ) ;  
 / /   K i c k   o f f   o n e   r e s i z e   t o   f i x   a l l   v i d e o s   o n   p a g e   l o a d  } ) . r e s i z e ( ) ;  
