Team:Heidelberg/Templates/Footer-DelRest
From 2013.igem.org
(Difference between revisions)
m |
m |
||
Line 9: | Line 9: | ||
<!-- lets have a nicer scrollbar --> | <!-- lets have a nicer scrollbar --> | ||
<script> | <script> | ||
- | + | Scrollbar = function(){ | |
- | + | var sb = this; | |
- | + | function($){ | |
- | + | $(function(){ | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
$(".carousel-caption").mCustomScrollbar({ | $(".carousel-caption").mCustomScrollbar({ | ||
autoHideScrollbar:true, | autoHideScrollbar:true, | ||
Line 30: | Line 26: | ||
}); | }); | ||
}); | }); | ||
- | $("#myCarousel").on("slide.bs.carousel", triggerScrollbarUpdate(".carousel-caption:visible");}); | + | $("#myCarousel").on("slide.bs.carousel", sb.triggerScrollbarUpdate(".carousel-caption:visible");}); |
- | triggerScrollbarUpdate_nav_tabs(); | + | sb.triggerScrollbarUpdate_nav_tabs(); |
- | + | } | |
+ | }; | ||
+ | Scrollbar.prototype.triggerScrollbarUpdate = function(e){ | ||
+ | setTimeout(function () { $(e).mCustomScrollbar("update"); }, 1000); | ||
+ | }; | ||
+ | Scrollbar.prototype.triggerScrollbarUpdate_nav_tabs = function(){ | ||
+ | $('.nav-tabs a').click(triggerScrollbarUpdate(".scrollContent")) | ||
+ | }; | ||
+ | (function(){ | ||
+ | scrollbar = new Scrollbar; | ||
+ | } | ||
+ | )(jQuery); | ||
</script> | </script> | ||
Line 90: | Line 97: | ||
$('.labjournal-weekly:visible').hide(); | $('.labjournal-weekly:visible').hide(); | ||
$($('.labjournal-weekly')[0]).show(); | $($('.labjournal-weekly')[0]).show(); | ||
- | triggerScrollbarUpdate_nav_tabs(); | + | scrollbar.triggerScrollbarUpdate_nav_tabs(); |
}); | }); | ||
Line 97: | Line 104: | ||
$('.labjournal-weekly:visible').hide(); | $('.labjournal-weekly:visible').hide(); | ||
$($('.labjournal-weekly')[5]).show(); | $($('.labjournal-weekly')[5]).show(); | ||
- | triggerScrollbarUpdate_nav_tabs(); | + | scrollbar.triggerScrollbarUpdate_nav_tabs(); |
}); | }); | ||
Revision as of 16:56, 1 October 2013