In my test case, it works fine. When I use the same div with 26 links inside it in an li of a SmartMenus menu, I cannot obtain valid element top values (or widths either). Is there something that SmartMenus is doing with submenus that explains why I can’t get element positions or sizes? Is there another way to accomplish this? As the width of the browser window increases or decreases, I need to take away the bottom border of only those links that are on the last row.
If the code runs when the sub menu is hidden (it is hidden via display: none), then you won’t be able to obtain the links’ dimensions or position. A sample workaround would be to set it temporary display: block (but still keep it hidden, for example, via visibility: hidden), get the values you need and then set it display: none again.