}
});
- $('input[name="background-position-x"]').change(function() {
- bgImage.css('background-position', $(this).val() + ' top');
+ $( 'select[name="background-size"]' ).change( function() {
+ bgImage.css( 'background-size', $( this ).val() );
});
- $('input[name="background-repeat"]').change(function() {
- bgImage.css('background-repeat', $(this).val());
+ $( 'input[name="background-position"]' ).change( function() {
+ bgImage.css( 'background-position', $( this ).val() );
+ });
+
+ $( 'input[name="background-repeat"]' ).change( function() {
+ bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' );
+ });
+
+ $( 'input[name="background-attachment"]' ).change( function() {
+ bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' );
});
$('#choose-from-library-link').click( function( event ) {