xxxx.style.width (where xxxx is the variable representing the div) only returns the width as defined by CSS. It does not return the actual width after rendering has taken place. There are a number of Javascript options for this, one of which is the xxxx.offsetWidth property. Other options exist as well, each with its own subtle nuance as to what is included or not.
References:
No comments:
Post a Comment