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

Contents of /contributions/modules/panels_carousel/panels_carousel.js

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


Revision 1.1 - (show annotations) (download) (as text)
Tue Aug 14 23:23:40 2007 UTC (2 years, 3 months ago) by wimleers
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, DRUPAL-5--1-3, HEAD
Branch point for: DRUPAL-5
File MIME type: text/javascript
Initial commit of panels_carousel.module. This module provides a configurable 'carousel' Panel style that can be used by the Mini Panels module.
1 // $Id$
2
3 $(document).ready(function() {
4 var i;
5 var selector;
6 var settings;
7
8 // Add our custom easing function.
9 jQuery.easing["QuartEaseOut"] = function(p, t, b, c, d) {
10 return -c * ((t=t/d-1)*t*t*t - 1) + b;
11 };
12
13 // Waits until the height of the element that contains the carousel is
14 // greater than zero, then renders the carousel.
15 function renderCarouselOnHeight($e, settings) {
16 if ($e.height()) {
17 $e.jcarousel(settings);
18 }
19 else {
20 setTimeout(function(){ renderCarouselOnHeight($e, settings); }, 50);
21 }
22 }
23
24 for (i in Drupal.settings.jcarousel) {
25 selector = Drupal.settings.jcarousel[i]['selector'];
26 settings = Drupal.settings.jcarousel[i]['settings'];
27
28 // Render the carousel when the height is greater than zero. This prevents
29 // errors being spit out by the jCarousel plugin. An occurrence of this
30 // weird problem is at the "edit content" page of Panel Pages.
31 renderCarouselOnHeight($(selector), settings);
32 }
33 });

  ViewVC Help
Powered by ViewVC 1.1.2