I have a <p> element somewhere on my page, and I want it to contain the viewport value, which I can get with:
<p>
<script>
document.write($(this).width());
</script>
</p>
But it shows it “statically”. How can I get this value to update dynamically (showing the live actual value) when I resize the browser viewport?
Well, maybe it will be usefull, done it with following code, not shure it’s the best solution, but it works! Maybe someone can improve it or suggest another, more simple way.