Team:NCTU Formosa/source/result-video

From 2014.igem.org

(Difference between revisions)
 
(15 intermediate revisions not shown)
Line 1: Line 1:
<html>
<html>
-
<head>
+
<div style="margin:0pxauto;">
-
<script>
+
 <iframe width="310" height="174" src="//www.youtube.com/embed/wT4bL4Iwh2c" frameborder="0" allowfullscreen></iframe>
-
$(function() {
+
<iframe width="310" height="174" src="//www.youtube.com/embed/wUgzPGDicW4" frameborder="0" allowfullscreen></iframe>
-
  if(typeof YOUTUBE_VIDEO_MARGIN == 'undefined') {
+
<iframe width="310" height="174" src="//www.youtube.com/embed/nuxcWp1NPsY" frameborder="0" allowfullscreen></iframe>
-
    YOUTUBE_VIDEO_MARGIN=5;
+
</div>
-
  }
+
-
  $('iframe').each(function(index,item) {
+
-
    if($(item).attr('src').match(/http(s)?:\/\/www\.youtube\.com/)) {
+
-
      var w=$(item).attr('width');
+
-
      var h=$(item).attr('height');
+
-
      var ar = h/w*100;
+
-
      ar=ar.toFixed(2);
+
-
      //Style iframe 
+
-
      $(item).css('position','absolute');
+
-
      $(item).css('top','0');
+
-
      $(item).css('left','0'); 
+
-
      $(item).css('width','100%');
+
-
      $(item).css('height','100%');
+
-
      $(item).css('max-width',w+'px');
+
-
      $(item).css('max-height', h+'px');     
+
-
      $(item).wrap('<div style="max-width:'+w+'px;margin:0 auto; padding:'+YOUTUBE_VIDEO_MARGIN+'px;" />');
+
-
      $(item).wrap('<div style="position: relative;padding-bottom: '+ar+'%; height: 0; overflow: hidden;" />');
+
-
    }
+
-
  });
+
-
});
+
-
</script>
+
-
</head>
+
-
 
+
-
 <iframe src="//www.youtube.com/embed/GoniS9oDj48" frameborder="0" allowfullscreen></iframe><iframe\ src="//www.youtube.com/embed/2J3PqUXa6iI" frameborder="0" allowfullscreen></iframe>
+
-
 
+
</html>
</html>

Latest revision as of 09:47, 15 October 2014