demo/inc/demo.js
function _drawBound (side, dist) {
        dist += 'px';
        switch (side) {
            case 'top':
                $('.boundary-top').css({
                    top: dist,
                    height: dist,
                    marginTop: '-' + dist
                });
                break;

            case 'right':
                $('.boundary-right').css({
                    right: dist,
                    width: dist,
                    marginRight: '-' + dist
                });
                break;

            case 'bottom':
                $('.boundary-bottom').css({
                    bottom: dist,
                    height: dist,
                    marginBottom: '-' + dist
                });
                break;

            case 'left':
                $('.boundary-left').css({
                    left: dist,
                    width: dist,
                    marginLeft: '-' + dist
                });
                break;

            default:
                break;
        }
    }
function _drawBound (side, dist) {
        dist += 'px';
        switch (side) {
            case 'top':
                $('.boundary-top').css({
                    top: dist,
                    height: dist,
                    marginTop: '-' + dist
                });
                break;

            case 'right':
                $('.boundary-right').css({
                    right: dist,
                    width: dist,
                    marginRight: '-' + dist
                });
                break;

            case 'bottom':
                $('.boundary-bottom').css({
                    bottom: dist,
                    height: dist,
                    marginBottom: '-' + dist
                });
                break;

            case 'left':
                $('.boundary-left').css({
                    left: dist,
                    width: dist,
                    marginLeft: '-' + dist
                });
                break;

            default:
                break;
        }
    }
function _drawBound ( side , dist ) { dist += 'px' ; switch ( side ) { case 'top' : $ ( '.boundary-top' ) . css ( { top : dist , height : dist , marginTop : '-' + dist } ) ; break ; case 'right' : $ ( '.boundary-right' ) . css ( { right : dist , width : dist , marginRight : '-' + dist } ) ; break ; case 'bottom' : $ ( '.boundary-bottom' ) . css ( { bottom : dist , height : dist , marginBottom : '-' + dist } ) ; break ; case 'left' : $ ( '.boundary-left' ) . css ( { left : dist , width : dist , marginLeft : '-' + dist } ) ; break ; default : break ; } }
Overlay a boundary line on the viewport when one is set by the user
Overlay a boundary line on the viewport when one is set by the user