Team:Calgary/Sandbox3
From 2011.igem.org
(Difference between revisions)
Line 2: | Line 2: | ||
<head> | <head> | ||
+ | <!--jQuery and jQuery-UI additions--> | ||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.js"></script> | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.js"></script> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | ||
Line 213: | Line 214: | ||
*/ | */ | ||
</script> | </script> | ||
- | <!--Script to activate dropdown menu function.--> | + | <!--Script to activate dropdown menu function. Uses JQuery syntax.--> |
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | $(function () { | + | $(document).ready(function () { |
- | $(‘.dropdown’).each(function () { | + | $(‘.dropdown’).each(function () { |
- | $(this).parent().eq(0).hover(function () { | + | $(this).parent().eq(0).hover(function () { |
- | $(‘.dropdown:eq(0)’, this).show(); | + | $(‘.dropdown:eq(0)’, this).show(); |
- | }, function () { | + | }, function () { |
- | $(‘.dropdown:eq(0)’, this).hide(); | + | $(‘.dropdown:eq(0)’, this).hide(); |
- | }); | + | }); |
+ | }); | ||
}); | }); | ||
+ | |||
+ | </script> | ||
+ | <!--Circle effects. Redundancy: High. Efficiency: Bleh.--> | ||
+ | <script type="text/javascript"> | ||
+ | $(document).ready(function(){ | ||
+ | |||
+ | jQuery.fn.setcircle = function(){ | ||
+ | this.css({ | ||
+ | "display":"block", | ||
+ | "position":"absolute", | ||
+ | "margin-left":790, | ||
+ | "margin-top":-250, | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | jQuery.fn.resetcircle = function(){ | ||
+ | this.hide(); | ||
+ | this.setcircle(); | ||
+ | $('#home #circle0').show(); | ||
+ | $('#team #circle1').show(); | ||
+ | $('#project #circle2').show(); | ||
+ | $('#parts #circle3').show(); | ||
+ | $('#notebook #circle4').show(); | ||
+ | $('#outreach #circle5').show(); | ||
+ | $('#sponsors #circle6').show(); | ||
+ | } | ||
+ | //homebutton set | ||
+ | $('#homebutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle0').show(); | ||
+ | $('#circle0').setcircle(); | ||
+ | }); | ||
+ | $('#homebutton').mouseout(function(){ | ||
+ | $('#circle0').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //teambutton set | ||
+ | $('#teambutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle1').show(); | ||
+ | $('#circle1').setcircle(); | ||
+ | }); | ||
+ | $('#teambutton').mouseout(function(){ | ||
+ | $('#circle1').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //projectbutton set | ||
+ | $('#projectbutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle2').show(); | ||
+ | $('#circle2').setcircle(); | ||
+ | }); | ||
+ | $('#projectbutton').mouseout(function(){ | ||
+ | $('#circle2').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //partsbutton set | ||
+ | $('#partsbutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle3').show(); | ||
+ | $('#circle3').setcircle(); | ||
+ | }); | ||
+ | $('#partsbutton').mouseout(function(){ | ||
+ | $('#circle3').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //notebookbutton set | ||
+ | $('#notebookbutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle4').show(); | ||
+ | $('#circle4').setcircle(); | ||
+ | }); | ||
+ | $('#notebookbutton').mouseout(function(){ | ||
+ | $('#circle4').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //outreachbutton set | ||
+ | $('#outreachbutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle5').show(); | ||
+ | $('#circle5').setcircle(); | ||
+ | }); | ||
+ | $('#outreachbutton').mouseout(function(){ | ||
+ | $('#circle5').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //sponsorsbutton set | ||
+ | $('#sponsorsbutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle6').show(); | ||
+ | $('#circle6').setcircle(); | ||
+ | }); | ||
+ | $('#sponsorsbutton').mouseout(function(){ | ||
+ | $('#circle6').resetcircle(); | ||
+ | }); | ||
+ | |||
+ | //igembutton set | ||
+ | $('#igembutton').mouseover(function(){ | ||
+ | $('.headercircle').hide(); | ||
+ | $('#circle7').show(); | ||
+ | $('#circle7').setcircle(); | ||
+ | }); | ||
+ | $('#igembutton').mouseout(function(){ | ||
+ | $('#circle7').resetcircle(); | ||
+ | }); | ||
}); | }); | ||
</script> | </script> | ||
Line 534: | Line 641: | ||
#outreach #circle5, | #outreach #circle5, | ||
#sponsors #circle6{ | #sponsors #circle6{ | ||
- | display: | + | display: block; |
position: absolute; | position: absolute; | ||
- | margin-left: | + | margin-left: 790px; |
- | margin-top: - | + | margin-top: -250px; |
} | } | ||
Revision as of 18:19, 7 September 2011