Team:BNU-China/js/carousel.js

From 2014.igem.org

Revision as of 14:23, 15 July 2014 by Liubing (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


function mycarousel_initCallback(carousel) {

   jQuery('#next').bind('click', function() {
       carousel.next();
       return false;
   });
   jQuery('#prev').bind('click', function() {
       carousel.prev();
       return false;
   });
   
   
       $('.carousel ul li').mouseenter(function(e) {
           $(this).children('a').children('span').fadeIn(200);
       }).mouseleave(function(e) {
           $(this).children('a').children('span').fadeOut(200);
       });
 
   
   

};

// Ride the carousel... jQuery(document).ready(function() {

   jQuery(".carousel").jcarousel({
       scroll: 5,
       auto: 10,
       initCallback: mycarousel_initCallback,
       // This tells jCarousel NOT to autobuild prev/next buttons
       buttonNextHTML: null,
       buttonPrevHTML: null,
       wrap: 'last',
       animation: 800
   });

});