tot - Check-in [10]
Not logged in
[Browse]  [Home]  [Login]  [Reports]  [Search]  [Timeline
  [Patchset
Check-in Number: 10
Date: 2007-Mar-12 16:15:13 (local)
2007-Mar-12 15:15:13 (UTC)
User:rse
Branch:
Comment: allow the children nodes to be filtered
Tickets:
Inspections:
Files:
jquery/jquery.alternation.js      7 -> 10
Modified: jquery/jquery.alternation.js
===================================================================
--- jquery/jquery.alternation.js	2007-03-07 18:16:40 UTC (rev 9)
+++ jquery/jquery.alternation.js	2007-03-12 15:15:13 UTC (rev 10)
@@ -16,6 +16,7 @@
  *  </div>
  *
  *  $('.alternation').alternation({
+ *      children:    optional children selector                          (default: 'null')
  *      alternation: alternation type: "sequence" or "random"            (default: 'sequence')
  *      timeout:     alternation time (in ms)                            (default: 2000)
  *      animation:   animation type: "fade" or "slide"                   (default: "fade")
@@ -37,6 +38,7 @@
     /* jQuery static function */
     $.alternation = function(container, options) {
         var settings = {
+            'children':    null,
             'alternation': 'sequence',
             'timeout':     2000,
             'animation':   'fade',
@@ -46,7 +48,10 @@
         };
         if (options)
             $.extend(settings, options);
-        var elements = $(container).children();
+        if (settings.children === null)
+            var elements = $(container).children();
+        else
+            var elements = $(container).children(settings.children);
         if (elements.length > 1) {
             $(container).css('position', 'relative');
             $(container).css('height', settings["height"]);