jqueryexample.com Jquery - Change popup div Height based on Browser Size/Resize - jqueryexample.com

Jquery – Change popup div Height based on Browser Size/Resize by jqueryexample

In this example I am going to show an example for set a height a of an element according the browser height.

To get browser height we will use $(window).height(); property and we set page elements based on Window size re-size.

$(function(){
    $(window).resize(function(){
        var winHeight = $(window).height();
        var winWidth = $(window).width();
        $("#popBox").css('height',(h < 1024 || w < 800) ? 600 : 450);
    });
});

Did you like this? Share it:

Discussion

No comments yet, be the first.

Leave a Comment