get top left style if it exists
JavaScript
by Luke Harby
HTML
<ul class="index-posts row"><li id="affirmation" style="top: 3px; left: 0%;">
<a href="affirmation" class="post-trigger">
<p class="item-name">affirmation</p><p>
</p><p></p></a><p class="npf_link" data-npf="{"type":"link","url":"https://vimeo.com/153949952?share=copy","display_url":"https://vimeo.com/153949952?share=copy","title":"Affirmation (2016)","description":"Affirmation (2016) uses footage from the 1923 Buster Keaton film Three Ages as the basis for a guided meditation in vulnerability. Keaton wa","site_name":"Vimeo","poster":[{"media_key":"cd78c9656df6b9381417c980464efff7:86fa2ab3c65a5863-70","type":"image/webp","width":1920,"height":1080}]}"><a href="affirmation" class="post-trigger"></a><a href="https://vimeo.com/153949952?share=copy" target="_blank">Affirmation (2016)</a></p><p>Affirmation <br>2016<br>Single channel video</p><p>Affirmation uses footage from the 1923 Buster Keaton film Three Ages as the basis for a guided meditation in vulnerability. Keaton was badly injured shooting this portion of the film and chose to keep the jarring moment of impact in the finished comedy.</p><p></p>
</li><li id="effort" style="top: 261px;">
<a href="effort" class="post-trigger">
<p class="item-name">effort</p><p>
</p><p></p><div class="npf_row"><figure class="tmblr-full" data-orig-height="1000" data-orig-width="713"><img src="https://64.media.tumblr.com/d0d03da92f0ec700bf9aae4d6912dd38/b1f2ac6c91328716-f2/s640x960/9eb6114bae89b82c69822fed1f6f4ad34335049e.jpg" data-orig-height="1000" data-orig-width="713" srcset="https://64.media.tumblr.com/d0d03da92f0ec700bf9aae4d6912dd38/b1f2ac6c91328716-f2/s75x75_c1/2cc38731a6a28c2f0c733a297cd0930a09bc9df7.jpg 75w,...
JavaScript
const elems = document.querySelectorAll('.index-posts > li');
const newElems = Math.max(...[...elems].map(item => parseInt(item.style.top.split('px')[0])));
console.log(newElems);