/[drupal]/contributions/modules/jcarousel/jcarousel.js
ViewVC logotype

Diff of /contributions/modules/jcarousel/jcarousel.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.2.2.5, Wed Mar 25 18:10:22 2009 UTC revision 1.1.2.2.2.6, Thu Nov 5 20:09:59 2009 UTC
# Line 1  Line 1 
1  /* $Id: jcarousel.js,v 1.1.2.2.2.4 2009/02/19 16:50:43 robloach Exp $ */  /* $Id: jcarousel.js,v 1.1.2.2.2.5 2009/03/25 18:10:22 robloach Exp $ */
2    
3  /**  /**
4   * @file   * @file
# Line 41  Drupal.behaviors.jcarousel = function() Line 41  Drupal.behaviors.jcarousel = function()
41        skin = '';        skin = '';
42      }      }
43    
44        // Prepare callbacks for circular carousels
45        if (options['wrap'] == 'circular') {
46          var itemList = [];
47          // Add item to storage list, then remove it from the HTML so the carousel has no length
48          // The removing is necessary, otherwise the carousel will stop when it reaches the end
49          $(selector + ' li').each(function(){
50            itemList.push($(this).html());
51            this.parentNode.removeChild(this);
52          });
53    
54          options['itemVisibleInCallback'] = { onBeforeAnimation: function(carousel, item, i, state, e) {
55            jcarousel_itemVisibleInCallback(carousel, item, i, state, e, itemList);
56          }};
57    
58          options['itemVisibleOutCallback'] = { onAfterAnimation: jcarousel_itemVisibleOutCallback };
59        }
60    
61      // Create the countdown element on non-processed elements.      // Create the countdown element on non-processed elements.
62      $(selector + ':not(.jcarousel-processed)').addClass('jcarousel-processed' + skin).jcarousel(options);      $(selector + ':not(.jcarousel-processed)').addClass('jcarousel-processed' + skin).jcarousel(options);
63    });    });
64  };  };
65    
66    function jcarousel_itemVisibleInCallback(carousel, item, i, state, e, items) {
67      var idx = carousel.index(i, items.length);
68      carousel.add(i, items[idx - 1]);
69    }
70    
71    function jcarousel_itemVisibleOutCallback(carousel, item, i, state, e) {
72      carousel.remove(i);
73    }

Legend:
Removed from v.1.1.2.2.2.5  
changed lines
  Added in v.1.1.2.2.2.6

  ViewVC Help
Powered by ViewVC 1.1.2