mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Widget demo: Some more inline comments
This commit is contained in:
parent
92e37865a0
commit
cfaddbfb2a
@ -88,11 +88,17 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// initialize with default options
|
||||||
$( '#my-widget1' ).colorize();
|
$( '#my-widget1' ).colorize();
|
||||||
|
|
||||||
|
// initialize with two customized options
|
||||||
$( '#my-widget2' ).colorize({
|
$( '#my-widget2' ).colorize({
|
||||||
red: 60,
|
red: 60,
|
||||||
blue: 60
|
blue: 60
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// initialize with custom green value
|
||||||
|
// and a random callback to allow only colors with enough green
|
||||||
$( '#my-widget3' ).colorize( {
|
$( '#my-widget3' ).colorize( {
|
||||||
green: 128,
|
green: 128,
|
||||||
random: function( event, ui ) {
|
random: function( event, ui ) {
|
||||||
@ -100,12 +106,14 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// click to toggle enabled/disabled
|
||||||
$( '#disable' ).toggle(function() {
|
$( '#disable' ).toggle(function() {
|
||||||
$( ':custom-colorize' ).colorize( 'disable' );
|
$( ':custom-colorize' ).colorize( 'disable' );
|
||||||
}, function() {
|
}, function() {
|
||||||
$( ':custom-colorize' ).colorize( 'enable' );
|
$( ':custom-colorize' ).colorize( 'enable' );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// click to set options after initalization
|
||||||
$( '#black' ).click( function() {
|
$( '#black' ).click( function() {
|
||||||
$( ':custom-colorize' ).colorize( 'option', {
|
$( ':custom-colorize' ).colorize( 'option', {
|
||||||
red: 0,
|
red: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user