|
|
Line 197: |
Line 197: |
| | | |
| <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> |
- | <script type="text/javascript">
| |
- | $(document).ready(function(){
| |
- | $("#div_content").hide();
| |
- | $("#div_content").fadeIn(1000);
| |
- | $("#logo").click(function() {
| |
- | window.setTimeout(function() {
| |
- | document.location.href="https://2012.igem.org/Team:Tec-Monterrey"
| |
- | }, 1000);
| |
- | $("#div_content").fadeOut(1000);
| |
- | });
| |
- | $("#bt1").click(function() {
| |
- | window.setTimeout(function() {
| |
- | document.location.href="https://2012.igem.org/Team:Tec-Monterrey/allergen/project"
| |
- | }, 1000);
| |
- | $("#div_content").fadeOut(1000);
| |
- | });
| |
- | $("#bt2").click(function() {
| |
- | window.setTimeout(function() {
| |
- | document.location.href="https://2012.igem.org/Team:Tec-Monterrey/antifreeze/project"
| |
- | }, 1000);
| |
- | $("#div_content").fadeOut(1000);
| |
- | });
| |
- | $("#bt3").click(function() {
| |
- | window.setTimeout(function() {
| |
- | document.location.href="https://2012.igem.org/Team:Tec-Monterrey/hpractice"
| |
- | }, 1000);
| |
- | $("#div_content").fadeOut(1000);
| |
- | });
| |
- | $("#bt4").click(function() {
| |
- | window.setTimeout(function() {
| |
- | document.location.href="https://2012.igem.org/Team:Tec-Monterrey/extras"
| |
- | }, 1000);
| |
- | $("#div_content").fadeOut(1000);
| |
- | });
| |
- | $("#bt5").click(function() {
| |
- | window.setTimeout(function() {
| |
- | document.location.href="https://2012.igem.org/Team:Tec-Monterrey/team"
| |
- | }, 1000);
| |
- | $("#div_content").fadeOut(1000);
| |
- | });
| |
- | //Slides
| |
- | var currentPos = 0;
| |
- | var sWidth = 520;
| |
- | var slides = $('.slide');
| |
- | var numSlides = slides.length;
| |
- | $('#slidesContainer').css('overflow','hidden');
| |
- | slides.wrapAll('<div id="slideInner"></div>');
| |
- | slides.css({
| |
- | 'float':'left',
| |
- | 'width':sWidth
| |
- | });
| |
- | $('#slideInner').css('width',sWidth*numSlides);
| |
- | $('#slideshow').prepend('<span class="control" id="leftControl">Move left</span>');
| |
- | $('#slideshow').append('<span class="control" id="rightControl">Move right</span>');
| |
- | manageControls(currentPos);
| |
- | $('.control').bind('click', function() {
| |
- | currentPos = ($(this).attr('id') == 'rightControl') ? currentPos+1 : currentPos-1;
| |
- | manageControls(currentPos);
| |
- | $('#slideInner').animate({
| |
- | 'marginLeft' : sWidth*(-currentPos)
| |
- | });
| |
- | });
| |
- | function manageControls(position) {
| |
- | if(position == 0) { $('#leftControl').hide(); }
| |
- | else { $('#leftControl').show(); }
| |
- | if(position == numSlides-1) { $('#rightControl').hide(); }
| |
- | else { $('#rightControl').show(); }
| |
- | }
| |
- | //Slide Buttons
| |
- | $("#s1").click(function() {
| |
- | currentPos = 0;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | });
| |
- | $("#s2").click(function() {
| |
- | currentPos = 1;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | });
| |
- | $("#s3").click(function() {
| |
- | currentPos = 2;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | });
| |
- | $("#s4").click(function() {
| |
- | currentPos = 3;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | });
| |
- | $("#s5").click(function() {
| |
- | currentPos = 4;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | });
| |
- | $("#s6").click(function() {
| |
- | currentPos = 5;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | });
| |
- | function changeSlide(position) {
| |
- | $('#slideInner').animate({
| |
- | 'marginLeft' : sWidth*(-position)
| |
- | });
| |
- | }
| |
- | window.setInterval(function() {
| |
- | currentPos++;
| |
- | if (currentPos >= numSlides)
| |
- | currentPos = 0;
| |
- | manageControls(currentPos);
| |
- | changeSlide(currentPos);
| |
- | }, 5000);
| |
- |
| |
- | });
| |
- | </script>
| |
| </head> | | </head> |
| | | |