Hey All,
I am new to JS and was wonder if someone could help me out with a problem I am having.
On the page a I have multiple divs with the same class that I am targeting through this code.
$(document).ready(function() {
var portfolio_piece = $('.portfolio-piece-info-inner').height() / 2;
$('.portfolio-piece-info-inner').css('margin-top', portfolio_piece);
});
The problem I am having is that the variable is returning the height of the first .portfolio-piece-info-inner and applying it to the rest. What I would like it to do is find that variable of each .portfolio-piece-info-inner and apply it to that specific one.
Any Ideas?
Thanks!