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

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 835
    • 188
  • Source
  • Commits
  • Network (188)
  • Graphs
  • Tree: 1ded431

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 (19)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 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

updated demos to a standard format - class animations do not seem to work in 
safari (unsure why)
scottjehl (author)
Fri Feb 27 10:05:18 -0800 2009
commit  1ded43162afb181eeb7c
tree    bc6a1fffe44acc845550
parent  8f8d82782655f8a99de0
A demos/addClass/default.html 56 •••••
A demos/addClass/index.html 17 •••••
M demos/animate/default.html 16 ••••
M demos/effect/default.html 11 ••••
M demos/hide/default.html 69 ••••
M demos/index.html 2 ••
A demos/removeClass/default.html 56 •••••
A demos/removeClass/index.html 17 •••••
M demos/show/default.html 72 ••••
M demos/switchClass/default.html 28 ••••
M demos/toggle/default.html 60 ••••
M demos/toggleClass/default.html 20 ••••
Txt demos/addClass/default.html
  • View file @ 1ded431
... ...
@@ -0,0 +1,56 @@
  1
+<!doctype html>
  2
+<html lang="en">
  3
+<head>
  4
+  <title>jQuery UI Effects - addClass Demo</title>
  5
+  <link type="text/css" href="http://jquery-ui.googlecode.com/svn/trunk/themes/base/ui.all.css" rel="stylesheet" />
  6
+  <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/jquery-1.3.2.js"></script>
  7
+  <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/ui/effects.core.js"></script>
  8
+  <link type="text/css" href="http://jquery-ui.googlecode.com/svn/trunk/demos/demos.css" rel="stylesheet" />
  9
+  <style type="text/css">
  10
+    .toggler { width: 500px; height: 200px; position: relative;}
  11
+    #button { padding: .5em 1em; text-decoration: none; }
  12
+    #effect {position: relative; }
  13
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  14
+    .ui-effects-transfer { border: 2px dotted gray; } 
  15
+    .first { width: 240px; height: 135px; padding: 0.4em;  font-size: 1.2em; border-width: 1px; }
  16
+    .second { width: 480px; height: 135px; padding: 0.8em; font-size: 1.6em; border-width: 5px; }
  17
+  </style>
  18
+  <script type="text/javascript">
  19
+  $(function() {
  20
+    $("#button").click(function() {
  21
+      $('#effect').addClass('second', 1000, callback);
  22
+    });
  23
+    
  24
+    function callback(){
  25
+      setTimeout(function(){
  26
+        $('#effect').removeClass('second');
  27
+      }, 1000);
  28
+    }
  29
+  });
  30
+  </script>
  31
+</head>
  32
+<body>
  33
+
  34
+<div class="demo">
  35
+
  36
+<div class="toggler">
  37
+  <div id="effect" class="first ui-widget-content ui-corner-all">
  38
+    <h3 class="ui-widget-header ui-corner-all">Add Class</h3>
  39
+    <p>
  40
+      Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
  41
+    </p>
  42
+  </div>
  43
+</div>
  44
+
  45
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
  46
+
  47
+</div><!-- End demo -->
  48
+
  49
+<div class="demo-description">
  50
+
  51
+<p>Click the button above to preview the effect.</p>
  52
+
  53
+</div><!-- End demo-description -->
  54
+
  55
+</body>
  56
+</html>
Txt demos/addClass/index.html
  • View file @ 1ded431
... ...
@@ -0,0 +1,17 @@
  1
+<!doctype html>
  2
+<html lang="en">
  3
+<head>
  4
+  <title>jQuery UI Effects Demos</title>
  5
+  <link type="text/css" href="../demos.css" rel="stylesheet" />
  6
+</head>
  7
+<body>
  8
+
  9
+<div class="demos-nav">
  10
+  <h4>Examples</h4>
  11
+  <ul>
  12
+    <li class="demo-config-on"><a href="default.html">Default functionality</a></li>
  13
+  </ul>
  14
+</div>
  15
+
  16
+</body>
  17
+</html>
Txt demos/animate/default.html
  • View file @ 1ded431
... ...
@@ -1,25 +1,25 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Animate Demo</title>
  4
+  <title>jQuery UI Effects - Animate Demo</title>
5 5
   <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7 7
   <script type="text/javascript" src="../../ui/effects.core.js"></script>
8 8
   <link type="text/css" href="../demos.css" rel="stylesheet" />
9 9
   <style type="text/css">
10  
-    .toggler { width: 500px; height: 200px; }
  10
+    .toggler { width: 500px; height: 200px; position: relative;}
11 11
     #button { padding: .5em 1em; text-decoration: none; }
12  
-    #animate { width: 240px; height: 135px; padding: 0.4em; background: #fff;}
13  
-    #animate h3 { margin: 0; padding: 0.4em; text-align: center; }
  12
+    #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; background: #fff; }
  13
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
14 14
   </style>
15 15
   <script type="text/javascript">
16 16
   $(function() {
17 17
     $("#button").toggle(
18 18
       function() {
19  
-        $("#animate").animate({backgroundColor: '#aa0000', color: '#fff'}, 1000);
  19
+        $("#effect").animate({backgroundColor: '#aa0000', color: '#fff', width: 500}, 1000);
20 20
       },
21 21
       function() {
22  
-        $("#animate").animate({backgroundColor: '#fff', color: '#000'}, 1000);
  22
+        $("#effect").animate({backgroundColor: '#fff', color: '#000', width: 240}, 1000);
23 23
       }
24 24
     );
25 25
   });
... ...
@@ -30,7 +30,7 @@
30 30
 <div class="demo">
31 31
 
32 32
 <div class="toggler">
33  
-  <div id="animate" class="ui-widget-content ui-corner-all">
  33
+  <div id="effect" class="ui-widget-content ui-corner-all">
34 34
     <h3 class="ui-widget-header ui-corner-all">Animate</h3>
35 35
     <p>
36 36
       Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
... ...
@@ -38,7 +38,7 @@
38 38
   </div>
39 39
 </div>
40 40
 
41  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  41
+<a href="#" id="button" class="ui-state-default ui-corner-all">Toggle Effect</a>
42 42
 
43 43
 </div><!-- End demo -->
44 44
 
Txt demos/effect/default.html
  • View file @ 1ded431
... ...
@@ -1,7 +1,7 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Effect Demo</title>
  4
+  <title>jQuery UI Effects - Effect Demo</title>
5 5
   <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7 7
     <script type="text/javascript" src="../../ui/effects.core.js"></script>
... ...
@@ -23,7 +23,6 @@
23 23
     #button { padding: .5em 1em; text-decoration: none; }
24 24
     #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; }
25 25
     #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
26  
-    .resetLink { position: absolute; top: 50px; left: 40px; color: #ddd; font-size: 24px;  }
27 26
     .ui-effects-transfer { border: 2px dotted gray; } 
28 27
   </style>
29 28
   <script type="text/javascript">
... ...
@@ -37,10 +36,8 @@
37 36
       //most effect types need no options passed by default
38 37
       var options = {};
39 38
       //check if it's scale, transfer, or size - they need options explicitly set
40  
-      if(selectedEffect == 'scale'){ 
41  
-        options = {percent: 0}; 
42  
-      }
43  
-      else if(selectedEffect == 'transfer'){ options = { to: "#button" }; }
  39
+      if(selectedEffect == 'scale'){ options = {percent: 0}; }
  40
+      else if(selectedEffect == 'transfer'){ options = { to: "#button", className: 'ui-effects-transfer' }; }
44 41
       else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }
45 42
       
46 43
       //run the effect
... ...
@@ -91,7 +88,7 @@
91 88
   <option value="transfer">Transfer</option>
92 89
 </select>
93 90
 
94  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  91
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
95 92
 
96 93
 
97 94
 </div><!-- End demo -->
Txt demos/hide/default.html
  • View file @ 1ded431
... ...
@@ -1,23 +1,61 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Hide Demo</title>
  4
+  <title>jQuery UI Effects - Hide Demo</title>
5 5
   <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7 7
   <script type="text/javascript" src="../../ui/effects.core.js"></script>
  8
+  <script type="text/javascript" src="../../ui/effects.blind.js"></script>
8 9
   <script type="text/javascript" src="../../ui/effects.bounce.js"></script>
  10
+  <script type="text/javascript" src="../../ui/effects.clip.js"></script>
  11
+  <script type="text/javascript" src="../../ui/effects.drop.js"></script>
  12
+  <script type="text/javascript" src="../../ui/effects.explode.js"></script>
  13
+  <script type="text/javascript" src="../../ui/effects.fold.js"></script>
  14
+  <script type="text/javascript" src="../../ui/effects.highlight.js"></script>
  15
+  <script type="text/javascript" src="../../ui/effects.pulsate.js"></script>
  16
+  <script type="text/javascript" src="../../ui/effects.scale.js"></script>
  17
+  <script type="text/javascript" src="../../ui/effects.shake.js"></script>
  18
+  <script type="text/javascript" src="../../ui/effects.slide.js"></script>
  19
+  <script type="text/javascript" src="../../ui/effects.transfer.js"></script>
9 20
   <link type="text/css" href="../demos.css" rel="stylesheet" />
10 21
   <style type="text/css">
11 22
     .toggler { width: 500px; height: 200px; }
12 23
     #button { padding: .5em 1em; text-decoration: none; }
13  
-    #hide { width: 240px; height: 135px; padding: 0.4em; }
14  
-    #hide h3 { margin: 0; padding: 0.4em; text-align: center; }
  24
+    #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; }
  25
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  26
+    .ui-effects-transfer { border: 2px dotted gray; } 
15 27
   </style>
16 28
   <script type="text/javascript">
17 29
   $(function() {
  30
+
  31
+    //run the currently selected effect
  32
+    function runEffect(){
  33
+      //get effect type from 
  34
+      var selectedEffect = $('#effectTypes').val();
  35
+      
  36
+      //most effect types need no options passed by default
  37
+      var options = {};
  38
+      //check if it's scale, transfer, or size - they need options explicitly set
  39
+      if(selectedEffect == 'scale'){  options = {percent: 0}; }
  40
+      else if(selectedEffect == 'transfer'){ options = { to: "#button", className: 'ui-effects-transfer' }; }
  41
+      else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }
  42
+      
  43
+      //run the effect
  44
+      $("#effect").hide(selectedEffect,options,500,callback);
  45
+    };
  46
+    
  47
+    //callback function to bring a hidden box back
  48
+    function callback(){
  49
+      setTimeout(function(){
  50
+        $("#effect:hidden").removeAttr('style').hide().fadeIn();
  51
+      }, 1000);
  52
+    };
  53
+    
  54
+    //set effect from select menu value
18 55
     $("#button").click(function() {
19  
-      $('#hide').hide("bounce");
  56
+      runEffect();
20 57
     });
  58
+
21 59
   });
22 60
   </script>
23 61
 </head>
... ...
@@ -26,14 +64,33 @@
26 64
 <div class="demo">
27 65
 
28 66
 <div class="toggler">
29  
-  <div id="hide" class="ui-widget-content ui-corner-all">
  67
+  <div id="effect" class="ui-widget-content ui-corner-all">
30 68
     <h3 class="ui-widget-header ui-corner-all">Hide</h3>
31 69
     <p>
32 70
       Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
33 71
     </p>
34 72
   </div>
35 73
 </div>
36  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  74
+
  75
+<select name="effects" id="effectTypes">
  76
+  <option value="blind">Blind</option>
  77
+  <option value="bounce">Bounce</option>
  78
+  <option value="clip">Clip</option>
  79
+  <option value="drop">Drop</option>
  80
+  <option value="explode">Explode</option>
  81
+  <option value="fold">Fold</option>
  82
+  <option value="highlight">Highlight</option>
  83
+  <option value="puff">Puff</option>
  84
+  <option value="pulsate">Pulsate</option>
  85
+  <option value="scale">Scale</option>
  86
+  <option value="shake">Shake</option>
  87
+  <option value="size">Size</option>
  88
+  <option value="slide">Slide</option>
  89
+  <option value="transfer">Transfer</option>
  90
+</select>
  91
+
  92
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
  93
+
37 94
 
38 95
 </div><!-- End demo -->
39 96
 
Txt demos/index.html
  • View file @ 1ded431
... ...
@@ -250,6 +250,8 @@
250 250
           <dd><a href="slider/index.html">Slider</a></dd>
251 251
           <dd><a href="tabs/index.html">Tabs</a></dd>
252 252
         <dt>Effects</dt>
  253
+          <dd><a href="addClass/index.html">Add Class</a></dd>
  254
+          <dd><a href="removeClass/index.html">Remove Class</a></dd>
253 255
           <dd><a href="animate/index.html">Animate</a></dd>
254 256
           <dd><a href="effect/index.html">Effect</dd>
255 257
           <dd><a href="hide/index.html">Hide</a></dd>
Txt demos/removeClass/default.html
  • View file @ 1ded431
... ...
@@ -0,0 +1,56 @@
  1
+<!doctype html>
  2
+<html lang="en">
  3
+<head>
  4
+  <title>jQuery UI Effects - removeClass Demo</title>
  5
+  <link type="text/css" href="http://jquery-ui.googlecode.com/svn/trunk/themes/base/ui.all.css" rel="stylesheet" />
  6
+  <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/jquery-1.3.2.js"></script>
  7
+  <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/ui/effects.core.js"></script>
  8
+  <link type="text/css" href="http://jquery-ui.googlecode.com/svn/trunk/demos/demos.css" rel="stylesheet" />
  9
+  <style type="text/css">
  10
+    .toggler { width: 500px; height: 200px; position: relative;}
  11
+    #button { padding: .5em 1em; text-decoration: none; }
  12
+    #effect {  position: relative; }
  13
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  14
+    .ui-effects-transfer { border: 2px dotted gray; } 
  15
+    .first { width: 240px; height: 135px; padding: 0.4em;  font-size: 1.2em; border-width: 1px; }
  16
+    .second { width: 480px; height: 135px; padding: 0.8em; font-size: 1.6em; border-width: 5px; }
  17
+  </style>
  18
+  <script type="text/javascript">
  19
+  $(function() {
  20
+    $("#button").click(function() {
  21
+      $('#effect').removeClass('second', 1000, callback);
  22
+    });
  23
+    
  24
+    function callback(){
  25
+      setTimeout(function(){
  26
+        $('#effect').addClass('second');
  27
+      }, 1000);
  28
+    }
  29
+  });
  30
+  </script>
  31
+</head>
  32
+<body>
  33
+
  34
+<div class="demo">
  35
+
  36
+<div class="toggler">
  37
+  <div id="effect" class="first second ui-widget-content ui-corner-all">
  38
+    <h3 class="ui-widget-header ui-corner-all">Remove Class</h3>
  39
+    <p>
  40
+      Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
  41
+    </p>
  42
+  </div>
  43
+</div>
  44
+
  45
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
  46
+
  47
+</div><!-- End demo -->
  48
+
  49
+<div class="demo-description">
  50
+
  51
+<p>Click the button above to preview the effect.</p>
  52
+
  53
+</div><!-- End demo-description -->
  54
+
  55
+</body>
  56
+</html>
Txt demos/removeClass/index.html
  • View file @ 1ded431
... ...
@@ -0,0 +1,17 @@
  1
+<!doctype html>
  2
+<html lang="en">
  3
+<head>
  4
+  <title>jQuery UI Effects Demos</title>
  5
+  <link type="text/css" href="../demos.css" rel="stylesheet" />
  6
+</head>
  7
+<body>
  8
+
  9
+<div class="demos-nav">
  10
+  <h4>Examples</h4>
  11
+  <ul>
  12
+    <li class="demo-config-on"><a href="default.html">Default functionality</a></li>
  13
+  </ul>
  14
+</div>
  15
+
  16
+</body>
  17
+</html>
Txt demos/show/default.html
  • View file @ 1ded431
... ...
@@ -1,24 +1,62 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Show Demo</title>
  4
+  <title>jQuery UI Effects - Show Demo</title>
5 5
   <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7 7
   <script type="text/javascript" src="../../ui/effects.core.js"></script>
  8
+  <script type="text/javascript" src="../../ui/effects.blind.js"></script>
8 9
   <script type="text/javascript" src="../../ui/effects.bounce.js"></script>
  10
+  <script type="text/javascript" src="../../ui/effects.clip.js"></script>
  11
+  <script type="text/javascript" src="../../ui/effects.drop.js"></script>
  12
+  <script type="text/javascript" src="../../ui/effects.explode.js"></script>
  13
+  <script type="text/javascript" src="../../ui/effects.fold.js"></script>
  14
+  <script type="text/javascript" src="../../ui/effects.highlight.js"></script>
  15
+  <script type="text/javascript" src="../../ui/effects.pulsate.js"></script>
  16
+  <script type="text/javascript" src="../../ui/effects.scale.js"></script>
  17
+  <script type="text/javascript" src="../../ui/effects.shake.js"></script>
  18
+  <script type="text/javascript" src="../../ui/effects.slide.js"></script>
  19
+  <script type="text/javascript" src="../../ui/effects.transfer.js"></script>
9 20
   <link type="text/css" href="../demos.css" rel="stylesheet" />
10 21
   <style type="text/css">
11 22
     .toggler { width: 500px; height: 200px; }
12 23
     #button { padding: .5em 1em; text-decoration: none; }
13  
-    #show { width: 240px; height: 135px; padding: 0.4em; }
14  
-    #show h3 { margin: 0; padding: 0.4em; text-align: center; }
  24
+    #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; }
  25
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  26
+    .ui-effects-transfer { border: 2px dotted gray; } 
15 27
   </style>
16 28
   <script type="text/javascript">
17 29
   $(function() {
  30
+
  31
+    //run the currently selected effect
  32
+    function runEffect(){
  33
+      //get effect type from 
  34
+      var selectedEffect = $('#effectTypes').val();
  35
+      
  36
+      //most effect types need no options passed by default
  37
+      var options = {};
  38
+      //check if it's scale, transfer, or size - they need options explicitly set
  39
+      if(selectedEffect == 'scale'){  options = {percent: 100}; }
  40
+      else if(selectedEffect == 'transfer'){ options = { to: "#button", className: 'ui-effects-transfer' }; }
  41
+      else if(selectedEffect == 'size'){ options = { to: {width: 280,height: 185} }; }
  42
+      
  43
+      //run the effect
  44
+      $("#effect").show(selectedEffect,options,500,callback);
  45
+    };
  46
+    
  47
+    //callback function to bring a hidden box back
  48
+    function callback(){
  49
+      setTimeout(function(){
  50
+        $("#effect:visible").removeAttr('style').hide().fadeOut();
  51
+      }, 1000);
  52
+    };
  53
+    
  54
+    //set effect from select menu value
18 55
     $("#button").click(function() {
19  
-      $("#show").show("bounce");
  56
+      runEffect();
20 57
     });
21  
-    $('#show').hide();
  58
+    
  59
+    $("#effect").fadeOut();
22 60
   });
23 61
   </script>
24 62
 </head>
... ...
@@ -27,21 +65,39 @@
27 65
 <div class="demo">
28 66
 
29 67
 <div class="toggler">
30  
-  <div id="show" class="ui-widget-content ui-corner-all">
  68
+  <div id="effect" class="ui-widget-content ui-corner-all">
31 69
     <h3 class="ui-widget-header ui-corner-all">Show</h3>
32 70
     <p>
33 71
       Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
34 72
     </p>
35 73
   </div>
36 74
 </div>
37  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  75
+
  76
+<select name="effects" id="effectTypes">
  77
+  <option value="blind">Blind</option>
  78
+  <option value="bounce">Bounce</option>
  79
+  <option value="clip">Clip</option>
  80
+  <option value="drop">Drop</option>
  81
+  <option value="explode">Explode</option>
  82
+  <option value="fold">Fold</option>
  83
+  <option value="highlight">Highlight</option>
  84
+  <option value="puff">Puff</option>
  85
+  <option value="pulsate">Pulsate</option>
  86
+  <option value="scale">Scale</option>
  87
+  <option value="shake">Shake</option>
  88
+  <option value="size">Size</option>
  89
+  <option value="slide">Slide</option>
  90
+  <option value="transfer">Transfer</option>
  91
+</select>
  92
+
  93
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
38 94
 
39 95
 
40 96
 </div><!-- End demo -->
41 97
 
42 98
 <div class="demo-description">
43 99
 
44  
-<p>Click the button above to show the effect.</p>
  100
+<p>Click the button above to preview the effect.</p>
45 101
 
46 102
 </div><!-- End demo-description -->
47 103
 
Txt demos/switchClass/default.html
  • View file @ 1ded431
... ...
@@ -1,28 +1,26 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Switch Class Demo</title>
  4
+  <title>jQuery UI Effects - switchClass Demo</title>
5 5
   <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7 7
   <script type="text/javascript" src="../../ui/effects.core.js"></script>
8 8
   <link type="text/css" href="../demos.css" rel="stylesheet" />
9 9
   <style type="text/css">
10  
-    .toggler { width: 500px; height: 200px; }
  10
+    .toggler { width: 500px; height: 200px; position: relative;}
11 11
     #button { padding: .5em 1em; text-decoration: none; }
12  
-    #animate h3 { margin: 0; padding: 0.4em; text-align: center; }
13  
-    .first { width: 240px; height: 135px; padding: 0.4em; }
14  
-    .second { width: 480px; height: 135px; padding: 0.4em; font-size: 1.6em; }
  12
+    #effect { position: relative; }
  13
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  14
+    .ui-effects-transfer { border: 2px dotted gray; } 
  15
+    .first { width: 240px; height: 135px; padding: 0.4em;  font-size: 1.2em; border-width: 1px; }
  16
+    .second { width: 480px; height: 135px; padding: 0.8em; font-size: 1.6em; border-width: 5px; }
15 17
   </style>
16 18
   <script type="text/javascript">
17 19
   $(function() {
18  
-    $("#button").toggle(
19  
-      function() {
20  
-        $("#animate").switchClass('first', 'second');
21  
-      },
22  
-      function() {
23  
-        $("#animate").switchClass('second', 'first');
24  
-      }
25  
-    );
  20
+    $("#button").click(function(){
  21
+        $(".first").switchClass('first', 'second', 1000);
  22
+        $(".second").switchClass('second', 'first', 1000);
  23
+    });
26 24
   });
27 25
   </script>
28 26
 </head>
... ...
@@ -31,7 +29,7 @@
31 29
 <div class="demo">
32 30
 
33 31
 <div class="toggler">
34  
-  <div id="animate" class="first ui-widget-content ui-corner-all">
  32
+  <div id="effect" class="first ui-widget-content ui-corner-all">
35 33
     <h3 class="ui-widget-header ui-corner-all">Switch Class</h3>
36 34
     <p>
37 35
       Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
... ...
@@ -39,7 +37,7 @@
39 37
   </div>
40 38
 </div>
41 39
 
42  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  40
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
43 41
 
44 42
 </div><!-- End demo -->
45 43
 
Txt demos/toggle/default.html
  • View file @ 1ded431
... ...
@@ -1,23 +1,53 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Toggle Demo</title>
  4
+  <title>jQuery UI Effects - Toggle Demo</title>
5 5
   <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7 7
   <script type="text/javascript" src="../../ui/effects.core.js"></script>
  8
+  <script type="text/javascript" src="../../ui/effects.blind.js"></script>
8 9
   <script type="text/javascript" src="../../ui/effects.bounce.js"></script>
  10
+  <script type="text/javascript" src="../../ui/effects.clip.js"></script>
  11
+  <script type="text/javascript" src="../../ui/effects.drop.js"></script>
  12
+  <script type="text/javascript" src="../../ui/effects.explode.js"></script>
  13
+  <script type="text/javascript" src="../../ui/effects.fold.js"></script>
  14
+  <script type="text/javascript" src="../../ui/effects.highlight.js"></script>
  15
+  <script type="text/javascript" src="../../ui/effects.pulsate.js"></script>
  16
+  <script type="text/javascript" src="../../ui/effects.scale.js"></script>
  17
+  <script type="text/javascript" src="../../ui/effects.shake.js"></script>
  18
+  <script type="text/javascript" src="../../ui/effects.slide.js"></script>
  19
+  <script type="text/javascript" src="../../ui/effects.transfer.js"></script>
9 20
   <link type="text/css" href="../demos.css" rel="stylesheet" />
10 21
   <style type="text/css">
11 22
     .toggler { width: 500px; height: 200px; }
12 23
     #button { padding: .5em 1em; text-decoration: none; }
13  
-    #toggle { width: 240px; height: 135px; padding: 0.4em; }
14  
-    #toggle h3 { margin: 0; padding: 0.4em; text-align: center; }
  24
+    #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; }
  25
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  26
+    .ui-effects-transfer { border: 2px dotted gray; } 
15 27
   </style>
16 28
   <script type="text/javascript">
17 29
   $(function() {
  30
+    //run the currently selected effect
  31
+    function runEffect(){
  32
+      //get effect type from 
  33
+      var selectedEffect = $('#effectTypes').val();
  34
+      
  35
+      //most effect types need no options passed by default
  36
+      var options = {};
  37
+      //check if it's scale, transfer, or size - they need options explicitly set
  38
+      if(selectedEffect == 'scale'){  options = {percent: 0}; }
  39
+      else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }
  40
+      
  41
+      //run the effect
  42
+      $("#effect").toggle(selectedEffect,options,500);
  43
+    };
  44
+    
  45
+    //set effect from select menu value
18 46
     $("#button").click(function() {
19  
-      $("#toggle").toggle("bounce");
  47
+      runEffect();
20 48
     });
  49
+    
  50
+
21 51
   });
22 52
   </script>
23 53
 </head>
... ...
@@ -26,14 +56,32 @@
26 56
 <div class="demo">
27 57
 
28 58
 <div class="toggler">
29  
-  <div id="toggle" class="ui-widget-content ui-corner-all">
  59
+  <div id="effect" class="ui-widget-content ui-corner-all">
30 60
     <h3 class="ui-widget-header ui-corner-all">Toggle</h3>
31 61
     <p>
32 62
       Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
33 63
     </p>
34 64
   </div>
35 65
 </div>
36  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  66
+
  67
+<select name="effects" id="effectTypes">
  68
+  <option value="blind">Blind</option>
  69
+  <option value="bounce">Bounce</option>
  70
+  <option value="clip">Clip</option>
  71
+  <option value="drop">Drop</option>
  72
+  <option value="explode">Explode</option>
  73
+  <option value="fold">Fold</option>
  74
+  <option value="highlight">Highlight</option>
  75
+  <option value="puff">Puff</option>
  76
+  <option value="pulsate">Pulsate</option>
  77
+  <option value="scale">Scale</option>
  78
+  <option value="shake">Shake</option>
  79
+  <option value="size">Size</option>
  80
+  <option value="slide">Slide</option>
  81
+  <option value="transfer">Transfer</option>
  82
+</select>
  83
+
  84
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
37 85
 </div><!-- End demo -->
38 86
 
39 87
 <div class="demo-description">
Txt demos/toggleClass/default.html
  • View file @ 1ded431
... ...
@@ -1,22 +1,24 @@
1 1
 <!doctype html>
2 2
 <html lang="en">
3 3
 <head>
4  
-  <title>jQuery UI Effect Methods - Add Class Demo</title>
  4
+  <title>jQuery UI Effects - toggleClass Demo</title>
5 5
   <link type="text/css" href="http://jquery-ui.googlecode.com/svn/trunk/themes/base/ui.all.css" rel="stylesheet" />
6 6
   <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/jquery-1.3.2.js"></script>
7 7
   <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/ui/effects.core.js"></script>
8 8
   <link type="text/css" href="http://jquery-ui.googlecode.com/svn/trunk/demos/demos.css" rel="stylesheet" />
9 9
   <style type="text/css">
10  
-    .toggler { width: 500px; height: 200px; }
  10
+    .toggler { width: 500px; height: 200px; position: relative;}
11 11
     #button { padding: .5em 1em; text-decoration: none; }
12  
-    #animate { width: 240px; padding: 0.4em; }
13  
-    #animate h3 { margin: 0; padding: 0.4em; text-align: center; }
14  
-    .class { font-size: 1.6em; }
  12
+    #effect {  position: relative; }
  13
+    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
  14
+    .ui-effects-transfer { border: 2px dotted gray; } 
  15
+    .first { width: 240px; height: 135px; padding: 0.4em;  font-size: 1.2em; border-width: 1px; }
  16
+    .second { width: 480px; height: 135px; padding: 0.8em; font-size: 1.6em; border-width: 5px; }
15 17
   </style>
16 18
   <script type="text/javascript">
17 19
   $(function() {
18 20
     $("#button").click(function() {
19  
-      $('#animate').toggleClass('class', 1000);
  21
+      $('#effect').toggleClass('second', 1000);
20 22
     });
21 23
   });
22 24
   </script>
... ...
@@ -26,15 +28,15 @@
26 28
 <div class="demo">
27 29
 
28 30
 <div class="toggler">
29  
-  <div id="animate" class="ui-widget-content ui-corner-all">
30  
-    <h3 class="ui-widget-header ui-corner-all">Animate</h3>
  31
+  <div id="effect" class="first ui-widget-content ui-corner-all">
  32
+    <h3 class="ui-widget-header ui-corner-all">Toggle Class</h3>
31 33
     <p>
32 34
       Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
33 35
     </p>
34 36
   </div>
35 37
 </div>
36 38
 
37  
-<a href="#" id="button" class="ui-state-default ui-corner-all">Show Effect</a>
  39
+<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
38 40
 
39 41
 </div><!-- End demo -->
40 42
 

0 notes on commit 1ded431

Please log in to comment.
Blog | Support | Training | 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
  • 中文