Team:Freiburg/Templates/html/js.html

From 2014.igem.org

(Difference between revisions)
Line 41: Line 41:
<script type="text/javascript">
<script type="text/javascript">
-
     $(window).load(function() {
+
     $(document).ready(function(){
-
 
+
      // remove unnecessary css
-
 
+
       if ($('body').hasClass('mediawiki')){
-
       $('.gallery').each(function(){
+
        $('head link[rel="stylesheet"]').remove();
-
         $(this).magnificPopup({
+
        $('head style[type="text/css"]').remove();
-
          delegate: 'a',
+
      }
 +
      $('figure img').each(function(){
 +
        var parent = this.parentNode;
 +
        if (parent.tagName != 'A') return;
 +
         $(parent).magnificPopup({
           type: 'image',
           type: 'image',
           tLoading: 'Loading image #%curr%...',
           tLoading: 'Loading image #%curr%...',
Line 64: Line 68:
         });
         });
       });
       });
 +
    });
-
$('figure img').each(function(){
+
    $(window).load(function() {
-
        var parent = this.parentNode;
+
 
-
        if (parent.tagName != 'A') return;
+
 
-
         $(parent).magnificPopup({
+
      $('.gallery').each(function(){
 +
         $(this).magnificPopup({
 +
          delegate: 'a',
           type: 'image',
           type: 'image',
           tLoading: 'Loading image #%curr%...',
           tLoading: 'Loading image #%curr%...',

Revision as of 19:45, 8 October 2014