Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 16:48:57
Original
1884 people have browsed it

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);
}
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template