开发者

HTML5 drag height on window resize

开发者 https://www.devze.com 2023-04-05 15:33 出处:网络
i have this bit of code: var dragHeight = window.innerHeight - parseInt(jQuery(\"#drag_area\").css(\"margin-top\")) - 5; to set the drag height for each browser size.but say i start the browser not ma

i have this bit of code: var dragHeight = window.innerHeight - parseInt(jQuery("#drag_area").css("margin-top")) - 5; to set the drag height for each browser size. but say i start the browser not maximized and then maximize it, the drag height is still开发者_C百科 the same as previous and wont let me drag all the way to the bottom of screen, any help would be appreciated. thanks


It could be something like this...

var dragHeight,
    calcDragHeight = function() {
        dragHeight = window.innerHeight - parseInt($("#drag_area").css("margin-top")) - 5;
    };

calcDragHeight();

$(function() {
    $(window).resize(function() {calcDragHeight();});
});
0

精彩评论

暂无评论...
验证码 换一张
取 消