Difference between revisions of "Template:Exetercarousel"
Line 59: | Line 59: | ||
</header> <!-- End of carousel--> | </header> <!-- End of carousel--> | ||
+ | |||
+ | <!-- For Carousel --> | ||
+ | |||
+ | <!-- jQuery --> | ||
+ | <script src="https://2015.igem.org/Team:Exeter/half-slider-jquery.js?action=raw&ctype=text/javascript"></script> | ||
+ | |||
+ | <!-- Bootstrap Core JavaScript --> | ||
+ | <script src="https://2015.igem.org/Team:Exeter/half-slider-bootstrap-min.js?action=raw&ctype=text/javascript"></script> | ||
+ | |||
+ | <!-- Script to Activate the Carousel --> | ||
+ | <script> | ||
+ | $('.carousel').carousel({ | ||
+ | interval: 5000 //changes the speed | ||
+ | }) | ||
+ | </script> <!-- End of Carousel --> | ||
+ | |||
+ | <script> | ||
+ | $(document).ready(function() { | ||
+ | |||
+ | $(window).scroll(function () { | ||
+ | //if you hard code, then use console | ||
+ | //.log to determine when you want the | ||
+ | //nav bar to stick. | ||
+ | console.log($(window).scrollTop()) | ||
+ | if ($(window).scrollTop() > 882) { | ||
+ | $('.navbar-collapse').addClass('navbar-fixed-top'); | ||
+ | } | ||
+ | if ($(window).scrollTop() < 883) { | ||
+ | $('.navbar-collapse').removeClass('navbar-fixed-top'); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
+ | <script> | ||
+ | |||
+ | var main = function() { | ||
+ | |||
+ | var width = $(window).width(); | ||
+ | var mouseX = 0, limitX = width-350; | ||
+ | $(window).mousemove(function(e){ | ||
+ | // don't follow mouse while collapsed | ||
+ | if ($(window).width() > 768) { | ||
+ | var offset = $('.navbar-header').offset(); | ||
+ | mouseX = Math.min(e.pageX - offset.left, limitX); | ||
+ | if (mouseX < 0) mouseX = 0; | ||
+ | if (e.pageY < 0) mouseX = 0; | ||
+ | } | ||
+ | // but it will still return to original position when resized | ||
+ | if (e.pageY < 700) mouseX = 0; | ||
+ | if (e.pageY > 940) mouseX = 0; | ||
+ | }); | ||
+ | |||
+ | // cache the selector | ||
+ | var follower = $(".ribonostics"); | ||
+ | var xp = 0; | ||
+ | var loop = setInterval(function(){ | ||
+ | // change 12 to alter damping higher is slower | ||
+ | xp += (mouseX - xp) / 12; | ||
+ | if (xp < 100) follower.css({left:100}); | ||
+ | else follower.css({left:xp}); | ||
+ | |||
+ | }, 30); | ||
+ | |||
+ | }; | ||
+ | |||
+ | $(document).ready(main); | ||
+ | |||
+ | </script> | ||
+ | |||
</html> | </html> |
Revision as of 16:10, 25 August 2015
Meet the Exeter iGEM 2015 Team
Read more about the problem which our team is concerned with
Check out our modelling
-->