I’m wondering how can I access overflowing elements. I would like to copy their content in to another div or something.
Lets say I got a ul with 5 li elements, but only two are visible. So.. How can I get other 3 elements in another div?
I’m wondering how can I access overflowing elements. I would like to copy their
Share
You have to compute if something is visible or not and to do that you have to make assumptions. Below is a simple example of this. It assumes that the list is a traditional list (in that each item is below the next). It then uses a calculation to determine if the
offsetTopis greater than the container’s height. You can tailor this to see if something is partially visible or completely visible.means apply the effect if the item isn’t fully visible. To not move items that are partially visible change it to:
Full example:
A more general solution would be much more tedious. You would have to cater for items that are left, right, above or below the “viewport”.