Team:Wageningen UR/JS/scripts.js

From 2013.igem.org

(Difference between revisions)
 
(34 intermediate revisions not shown)
Line 7: Line 7:
     jQuery(document).ready(function ($) {
     jQuery(document).ready(function ($) {
-
$('.sub-project li:first-child a').prepend('<img src="https://static.igem.org/mediawiki/2013/6/65/Petri_dish.png">');
+
$('.sub-project li:first-child a, .sub-project li:first-child .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/6/65/Petri_dish.png">');
-
$('.sub-project li:nth-child(2) a').prepend('<img src="https://static.igem.org/mediawiki/2013/2/20/Aspergillus-icon.png">');
+
$('.sub-project li:nth-child(2) a, .sub-project li:nth-child(2) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/2/20/Aspergillus-icon.png">');
-
$('.sub-project li:nth-child(4) a').prepend('<img src="https://static.igem.org/mediawiki/2013/8/87/Atp-icon.png">');
+
$('.sub-project li:nth-child(3) a, .sub-project li:nth-child(3) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/lovastatin-icon2.png">');
-
$('.sub-project li:nth-child(5) a').prepend('<img src="https://static.igem.org/mediawiki/2013/6/6f/Ph-icon.png">');
+
$('.sub-project li:nth-child(4) a, .sub-project li:nth-child(4) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/8/87/Atp-icon.png">');
 +
$('.sub-project li:nth-child(5) a, .sub-project li:nth-child(5) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/6/6f/Ph-icon.png">');
 +
$('.sub-project li:nth-child(6) a, .sub-project li:nth-child(6) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/cyto-icon.png">');
 +
$('.sub-project li:nth-child(7) a, .sub-project li:nth-child(7) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/chromo-icon.png">');
 +
$('.sub-project li:nth-child(8) a, .sub-project li:nth-child(8) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/morphology-icon.png">');
 +
$('.sub-project li:nth-child(9) a, .sub-project li:nth-child(9) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/applications3-icon.png">');
-
$('.sub-modeling li:nth-child(2) a').prepend('<img src="https://static.igem.org/mediawiki/2013/3/33/Database-icon.png">');
+
$('.sub-modeling li:first-child a, .sub-modeling li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/flux-icon.png">');
 +
$('.sub-modeling li:nth-child(2) a, .sub-modeling li:nth-child(2) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/3/33/Database-icon.png">');
-
$('.sub-parts li:first-child a').prepend('<img src="https://static.igem.org/mediawiki/2013/7/7c/Biobricks-icon.png">');
+
$('.sub-parts li:first-child a, .sub-parts li:first-child .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/7/7c/Biobricks-icon.png">');
-
$('.sub-parts li:nth-child(2) a').prepend('<img src="https://static.igem.org/mediawiki/2013/f/f3/Imprbiobricks-icon.png">');
+
$('.sub-parts li:nth-child(2) a, .sub-parts li:nth-child(2) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/f/f3/Imprbiobricks-icon.png">');
-
$('.sub-human-practices li:nth-child(3) a').prepend('<img src="https://static.igem.org/mediawiki/2013/c/c8/Conference-icon.png">');
+
$('.sub-team li:first-child a, .sub-team li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/members-icon.png">');
-
$('.sub-human-practices li:nth-child(4) a').prepend('<img src="https://static.igem.org/mediawiki/2013/5/59/Collaborations-icon.png">');
+
$('.sub-team li:nth-child(2) a, .sub-team li:nth-child(2) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/profile-icon.png">');
 +
$('.sub-team li:nth-child(3) a, .sub-team li:nth-child(3) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/Medals-icon.png">');
 +
$('.sub-team li:nth-child(4) a, .sub-team li:nth-child(4) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/sponsors-icon.png">');
-
$('.subs .extern').css({'background-image': 'none', 'padding-right': '0'});
+
$('.sub-safety li:first-child a, .sub-safety li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/intro-icon.png">');
 +
$('.sub-safety li:nth-child(2) a, .sub-safety li:nth-child(2) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/general-safety-icon.png">');
 +
$('.sub-safety li:nth-child(3) a, .sub-safety li:nth-child(3) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/fungi-safety-icon.png">');
 +
$('.sub-safety li:nth-child(4) a, .sub-safety li:nth-child(4) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/regulations-icon.png">');
 +
$('.sub-safety li:nth-child(5) a, .sub-safety li:nth-child(5) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/suggestion-icon.png">');
 +
$('.sub-safety li:nth-child(6) a, .sub-safety li:nth-child(6) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/applications3-icon.png">');
-
$('#filters a').click(function () {
+
$('.sub-human-practices li:first-child a, .sub-human-practices li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/vitruvian-icon.png">');
-
    var ourClass = $(this).attr('class');
+
$('.sub-human-practices li:nth-child(2) a, .sub-human-practices li:nth-child(2) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/9/98/Cafe-icon.png">');
-
    $('#container').children('div.' + ourClass).hide('fast').removeClass('item');
+
$('.sub-human-practices li:nth-child(3) a, .sub-human-practices li:nth-child(3) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/c/c8/Conference-icon.png">');
-
    $('#container').masonry();
+
$('.sub-human-practices li:nth-child(4) a, .sub-human-practices li:nth-child(4) .selflink').prepend('<img src="https://static.igem.org/mediawiki/2013/5/59/Collaborations-icon.png">');
-
});
+
 
 +
$('.sub-notebook li:first-child a, .sub-notebook li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/protocols-icon.png">');
 +
$('.sub-notebook li:nth-child(2) a, .sub-notebook li:nth-child(2) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/protocols-icon.png">');
 +
 
 +
$('.subs .extern').css({'background-image': 'none', 'padding-right': '0'});
$("#footer-box #footer:nth-child(2) ul").clone(true, true).contents().appendTo('#footer-box #footer:first-child ul');
$("#footer-box #footer:nth-child(2) ul").clone(true, true).contents().appendTo('#footer-box #footer:first-child ul');
$("#footer-box #footer:nth-child(2)").remove();
$("#footer-box #footer:nth-child(2)").remove();
 +
      $(window).load(function(){
         $('#topmenu .project, ul.sub-project').hover(
         $('#topmenu .project, ul.sub-project').hover(
             function() {
             function() {
Line 35: Line 53:
             }
             }
         );
         );
-
         $('#topmenu .modeling, ul.sub-modeling').hover(
+
         $('#topmenu .modeling a, ul.sub-modeling').hover(
             function() {
             function() {
                 $('ul.sub-modeling').toggleClass('active');
                 $('ul.sub-modeling').toggleClass('active');
Line 65: Line 83:
             }
             }
         );
         );
 +
    });
     });
     });
});
});

Latest revision as of 13:30, 10 September 2013

$=jQuery.noConflict();

$('h1.firstHeading, #contentSub').remove(); $('#topmenu .menucenter li .selflink').parent().addClass('active');

$(function ($) {

   jQuery(document).ready(function ($) {

$('.sub-project li:first-child a, .sub-project li:first-child .selflink').prepend('<img src="Petri_dish.png">'); $('.sub-project li:nth-child(2) a, .sub-project li:nth-child(2) .selflink').prepend('<img src="Aspergillus-icon.png">'); $('.sub-project li:nth-child(3) a, .sub-project li:nth-child(3) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/lovastatin-icon2.png">'); $('.sub-project li:nth-child(4) a, .sub-project li:nth-child(4) .selflink').prepend('<img src="Atp-icon.png">'); $('.sub-project li:nth-child(5) a, .sub-project li:nth-child(5) .selflink').prepend('<img src="Ph-icon.png">'); $('.sub-project li:nth-child(6) a, .sub-project li:nth-child(6) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/cyto-icon.png">'); $('.sub-project li:nth-child(7) a, .sub-project li:nth-child(7) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/chromo-icon.png">'); $('.sub-project li:nth-child(8) a, .sub-project li:nth-child(8) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/morphology-icon.png">'); $('.sub-project li:nth-child(9) a, .sub-project li:nth-child(9) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/applications3-icon.png">');

$('.sub-modeling li:first-child a, .sub-modeling li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/flux-icon.png">'); $('.sub-modeling li:nth-child(2) a, .sub-modeling li:nth-child(2) .selflink').prepend('<img src="Database-icon.png">');

$('.sub-parts li:first-child a, .sub-parts li:first-child .selflink').prepend('<img src="Biobricks-icon.png">'); $('.sub-parts li:nth-child(2) a, .sub-parts li:nth-child(2) .selflink').prepend('<img src="Imprbiobricks-icon.png">');

$('.sub-team li:first-child a, .sub-team li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/members-icon.png">'); $('.sub-team li:nth-child(2) a, .sub-team li:nth-child(2) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/profile-icon.png">'); $('.sub-team li:nth-child(3) a, .sub-team li:nth-child(3) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/Medals-icon.png">'); $('.sub-team li:nth-child(4) a, .sub-team li:nth-child(4) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/sponsors-icon.png">');

$('.sub-safety li:first-child a, .sub-safety li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/intro-icon.png">'); $('.sub-safety li:nth-child(2) a, .sub-safety li:nth-child(2) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/general-safety-icon.png">'); $('.sub-safety li:nth-child(3) a, .sub-safety li:nth-child(3) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/fungi-safety-icon.png">'); $('.sub-safety li:nth-child(4) a, .sub-safety li:nth-child(4) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/regulations-icon.png">'); $('.sub-safety li:nth-child(5) a, .sub-safety li:nth-child(5) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/suggestion-icon.png">'); $('.sub-safety li:nth-child(6) a, .sub-safety li:nth-child(6) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/applications3-icon.png">');

$('.sub-human-practices li:first-child a, .sub-human-practices li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/vitruvian-icon.png">'); $('.sub-human-practices li:nth-child(2) a, .sub-human-practices li:nth-child(2) .selflink').prepend('<img src="Cafe-icon.png">'); $('.sub-human-practices li:nth-child(3) a, .sub-human-practices li:nth-child(3) .selflink').prepend('<img src="Conference-icon.png">'); $('.sub-human-practices li:nth-child(4) a, .sub-human-practices li:nth-child(4) .selflink').prepend('<img src="Collaborations-icon.png">');

$('.sub-notebook li:first-child a, .sub-notebook li:first-child .selflink').prepend('<img src="http://beauvillemedia.nl/igem/protocols-icon.png">'); $('.sub-notebook li:nth-child(2) a, .sub-notebook li:nth-child(2) .selflink').prepend('<img src="http://beauvillemedia.nl/igem/protocols-icon.png">');

$('.subs .extern').css({'background-image': 'none', 'padding-right': '0'});

$("#footer-box #footer:nth-child(2) ul").clone(true, true).contents().appendTo('#footer-box #footer:first-child ul'); $("#footer-box #footer:nth-child(2)").remove();

      $(window).load(function(){
       $('#topmenu .project, ul.sub-project').hover(
           function() {
               $('ul.sub-project').toggleClass('active');
           }
       );
       $('#topmenu .modeling a, ul.sub-modeling').hover(
           function() {
               $('ul.sub-modeling').toggleClass('active');
           }
       );
       $('#topmenu .parts, ul.sub-parts').hover(
           function() {
               $('ul.sub-parts').toggleClass('active');
           }
       );
       $('#topmenu .notebook, ul.sub-notebook').hover(
           function() {
               $('ul.sub-notebook').toggleClass('active');
           }
       );
       $('#topmenu .safety, ul.sub-safety').hover(
           function() {
               $('ul.sub-safety').toggleClass('active');
           }
       );
       $('#topmenu .team, ul.sub-team').hover(
           function() {
               $('ul.sub-team').toggleClass('active');
           }
       );
       $('#topmenu .menuright, ul.sub-human-practices').hover(
           function() {
               $('ul.sub-human-practices').toggleClass('active');
           }
       );
   }); 
   });

});