How to use javascript to capture the width of an element as the browser window gets bigger/smaller?
The issue I am trying to solve is that
I have several lines of text within a td, but I want to only show “…” if the length of my content exceeded the length of the td. As the browser window changes, I want to dynamically determine whether I should use … or there is enough space for my content.
It’s not about resolution, it’s about the actual size of the window, where you can drag the corner of the window to make it bigger/smaller
Thanks!
You could implement it yourself by listening to a window.onresize event (jquery : http://api.jquery.com/resize/) . Or just use plugins like:
http://dotdotdot.frebsite.nl/
I searched for ‘ellipsis jquery’ in google, btw. Ellipsis being the ‘…’