detect div visibility to determine width instead of a fixed pixel size