]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget demo: Some more inline comments
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 2 Jun 2011 11:25:12 +0000 (13:25 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 2 Jun 2011 11:25:12 +0000 (13:25 +0200)
demos/widget/default.html

index a9284a423421048ee6769d32229aa9df5c01503f..ec272e994583240c10265c95f076fcb97b4b35cb 100644 (file)
                        }
                });
 
+               // initialize with default options
                $( '#my-widget1' ).colorize();
+
+               // initialize with two customized options
                $( '#my-widget2' ).colorize({
                        red: 60,
                        blue: 60
                });
+
+               // initialize with custom green value
+               // and a random callback to allow only colors with enough green
                $( '#my-widget3' ).colorize( {
                        green: 128,
                        random: function( event, ui ) {
                        }
                });
 
+               // click to toggle enabled/disabled
                $( '#disable' ).toggle(function() {
                        $( ':custom-colorize' ).colorize( 'disable' );
                }, function() {
                        $( ':custom-colorize' ).colorize( 'enable' );
                });
 
+               // click to set options after initalization
                $( '#black' ).click( function() {
                        $( ':custom-colorize' ).colorize( 'option', {
                                red: 0,