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"> | ||
- | $( | + | $(document).ready(function(){ |
- | + | // remove unnecessary css | |
- | + | if ($('body').hasClass('mediawiki')){ | |
- | $('. | + | $('head link[rel="stylesheet"]').remove(); |
- | $( | + | $('head style[type="text/css"]').remove(); |
- | + | } | |
+ | $('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: | ||
}); | }); | ||
}); | }); | ||
+ | }); | ||
- | $( | + | $(window).load(function() { |
- | + | ||
- | + | ||
- | $( | + | $('.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