views:

46

answers:

1

Hi All

I'm using the jquery resize to resize content on my webpage. It works, but I want that when the element reaches the desired height or width, it should stop resizing, how do I achieve this?

Here's the code:

$(window).resize(function(){
    $(map).height(win.height() - 210);

    if($(window).height() == 300){
        $(map).css({
                    "height": "250px"
                    });
    }
});

I did an if statement but it still doesn't work, what's wrong with the code. Please advise me on this?

Thanks in advance.

A: 

You're saying if it = 300. Tthat is very specific, I would use >= 300

Kerry
I just did >= 300, but it jumps to that height and it stays at that height, no matter how I resize the window after. I think the resize event stops running when it reaches that height of 300. All I want is when it reaches 300px height, a scrollbar should appear and the user can scroll up to see the rest of the content. Do you know how to that?
Shaoz