I'm using vw
for previous divs, now I want to set an alert if a div is moved to the very left. Here's the div:
<div id='pagination'>some stuff</div>
Now its width is set to 84vw
, which was calculated from early functions. I want to alert when its margin-left equals -84vw
. I tried this in js but no luck:
if ($('#pagination').css('margin-left') == '-84vw') {
alert('you're good to go!');
}
Could anyone help me with this argument? The real headache is I can't change vw
to px
.