github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 839
    • 189
  • Source
  • Commits
  • Network (189)
  • Graphs
  • Tree: a02ac5f

click here to add a description

click here to add a homepage

  • Switch Branches (8)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
    • widget-super
  • Switch Tags (20)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.3
    • 1.8.2
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Tabs: fixed stopping a rotation
Klaus Hartl (author)
Sat Feb 28 14:10:30 -0800 2009
commit  a02ac5f3721c14b2a20c
tree    bfe785781718afb35e77
parent  517d5ab62ca98da1eb2e
M ui/ui.tabs.js 29 ••••
Txt ui/ui.tabs.js
  • View file @ a02ac5f
... ...
@@ -639,29 +639,30 @@ $.extend($.ui.tabs.prototype, {
639 639
 
640 640
     var self = this, o = this.options, t = o.selected;
641 641
 
642  
-    function rotate() {
  642
+    var rotate = function() {
643 643
       clearTimeout(self.rotation);
644 644
       self.rotation = setTimeout(function() {
645 645
         t = ++t < self.anchors.length ? t : 0;
646 646
         self.select(t);
647 647
       }, ms);
648  
-    }
  648
+    };
  649
+    
  650
+    var stop = !continuing ?
  651
+      function(e) {
  652
+        if (e.clientX) { // in case of a true click
  653
+          clearTimeout(self.rotation);
  654
+          self.element.unbind('tabsshow', rotate);
  655
+        }
  656
+      } :
  657
+      function(e) {
  658
+        t = o.selected;
  659
+        rotate();
  660
+      };
649 661
 
650 662
     // start rotation
651 663
     if (ms) {
652 664
       this.element.bind('tabsshow', rotate); // will not be attached twice
653  
-      this.anchors.bind(o.event + '.tabs', !continuing ?
654  
-        function(e) {
655  
-          if (e.clientX) { // in case of a true click
656  
-            clearTimeout(self.rotation);
657  
-            self.element.unbind('tabsshow', rotate);
658  
-          }
659  
-        } :
660  
-        function(e) {
661  
-          t = o.selected;
662  
-          rotate();
663  
-        }
664  
-      );
  665
+      this.anchors.bind(o.event + '.tabs', stop);
665 666
       rotate();
666 667
     }
667 668
     // stop rotation

0 notes on commit a02ac5f

Please log in to comment.
Blog | Support | Training | Job Board | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server
  • English
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文