Varun
Varun

Reputation: 5061

Change minWidth and minHeight on the fly

I am using jquery-resizable i am stuck with an issue that i dont know min width and height at the time of binding an element for resizing but i know its boundaries when i start resizing

so i want to do something and edit the minWidth and minHeight property of resizable without altering the jquery.ui.resizable.js can i do this from start method of the function, if yes then how to do it?

$("#mainDiv").resizable({
        handles: 's, e',
        maxWidth : 10000,
        maxHeight : 10000,
        start: function(event, ui) {
        wall.min = null;
        wall.max = null;
        wall.minEle = null;
        wall.maxEle = null;
        lastShift = 0;
        var haschildren = ($("#mainDiv").children().size() > 0);
        if(haschildren){
            if(ui.handle == "e"){// check first s or e
                setMinMax(document.getElementById("mainDiv"), true, true);
                addEffected(document.getElementById("mainDiv"), true);
                checkInnerElementWidth(document.getElementById("mainDiv"), true);
            }
            else{
                setMinMax(document.getElementById("mainDiv"), false, true);
                addEffected(document.getElementById("mainDiv"), true);
                checkInnerElementHieght(document.getElementById("mainDiv"), true);
            }
        }
    }
});

at the end of the start i have my boundary conditions there with me

EDIT : also i want a solution for auto scroll its not provided with resizable, the page size is increasing but to an extent only i want it to keep scrolling until user resizes an element

Upvotes: 1

Views: 573

Answers (1)

NullDivision
NullDivision

Reputation: 159

I honestly don't see why you'd have to change dimensions. If it's an ajax event or something the parent should auto-update it's width and height as long as they're within the boundaries of the min- and max-height.

Some specificity as to what you're trying to achieve would be nice.

Upvotes: 1

Related Questions