demo/inc/demo.js
function (evt) {
            var target = evt.target;
            var val = parseInt(target.value, 10);
            var id = target.id;

            // Positive value was entered (negative values are allowed, but the boundaries would be off screen)
            if (val > 0) {
                if ($showBoundsCheck.is(':checked')) {
                    $('.boundary-' + id).show();
                    _drawBound(id, val);
                }
                else {
                    $('.boundary-' + id).hide();
                }
            }
            // Hide boundaries
            else {
                $('.boundary-' + id).hide();
            }

            // Update the page
            withinviewport.defaults[id] = val;
            _updateBoxes();
            _toggleBoundaryToggle();
        }
function (evt) {
            var target = evt.target;
            var val = parseInt(target.value, 10);
            var id = target.id;

            // Positive value was entered (negative values are allowed, but the boundaries would be off screen)
            if (val > 0) {
                if ($showBoundsCheck.is(':checked')) {
                    $('.boundary-' + id).show();
                    _drawBound(id, val);
                }
                else {
                    $('.boundary-' + id).hide();
                }
            }
            // Hide boundaries
            else {
                $('.boundary-' + id).hide();
            }

            // Update the page
            withinviewport.defaults[id] = val;
            _updateBoxes();
            _toggleBoundaryToggle();
        }
function ( evt ) { var target = evt . target ; var val = parseInt ( target . value , 10 ) ; var id = target . id ; // Positive value was entered (negative values are allowed, but the boundaries would be off screen) if ( val > 0 ) { if ( $showBoundsCheck . is ( ':checked' ) ) { $ ( '.boundary-' + id ) . show ( ) ; _drawBound ( id , val ) ; } else { $ ( '.boundary-' + id ) . hide ( ) ; } } // Hide boundaries else { $ ( '.boundary-' + id ) . hide ( ) ; } // Update the page withinviewport . defaults [ id ] = val ; _updateBoxes ( ) ; _toggleBoundaryToggle ( ) ; }
When a boundary value changes
When a boundary value changes