Home > Web Front-end > JS Tutorial > jQuery method to find the highest element on a web page_jquery

jQuery method to find the highest element on a web page_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:08:17
Original
1649 people have browsed it

The example in this article describes how jQuery finds the highest element on a web page. Share it with everyone for your reference. The details are as follows:

This JS code uses jQuery to traverse the elements on the web page and find the highest element among them

$(document).ready(function() {
  var maxHeight = -1;
  $('.features').each(function() {
   maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
  });
  $('.features').each(function() {
   $(this).height(maxHeight);
  });
});
Copy after login

I hope this article will be helpful to everyone’s jQuery programming.

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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template