I have this line:
$("#clients-edit-wrapper").height($(window).height()-150);
I would like to apply that height function to more than just that specific ID in one line of jQuery. Is there a way to chain elements together and apply that height function once for multiple elements? Basically, I want to apply that height function to 3 or 4 other DIVs but I would rather not have 3 or 4 more lines of jQuery to accomplish this.
Is this possible?
Answer from VisioN below (shows how much of a jQuery newbie I am!):
You can use either multiple selector:
$("#clients-edit-wrapper, #div2, #div3").height($(window).height() - 150);
Or class selector (which is certainly better!):
<!-- HTML -->
<div id="clients-edit-wrapper" class="myClass"></div>
<div id="div2" class="myClass"></div>
<div id="div3" class="myClass"></div>
// JavaScript
$(".myClass").height($(window).height() - 150);
You can use either multiple selector:
Or class selector (which is certainly better!):