Home  >  Article  >  Web Front-end  >  Solution to the problem that using the resize event does not work on the frame when the browser window size changes_jquery

Solution to the problem that using the resize event does not work on the frame when the browser window size changes_jquery

WBOY
WBOYOriginal
2016-05-16 16:48:571807browse

The solution to the problem that using the resize event does not work on the frame when the browser window size changes is as follows:

Copy code The code is as follows:

$(window).resize(function(){
var surH = $(window).height();
$(".pic_conent").height(surH);
}

When the browser changes, zoom in or out, there is no response;

Method 1: Add onLoad="" onResize="" method to the tag and write the corresponding method. Method 2: window. onresize=function(){///....} Just write the corresponding code in the method. Both methods can basically solve your problem

Copy code The code is as follows:

window.onresize=function(){
var surH = $(window).height() ;
$(".pic_conent").height(surH);
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn