Why scrollWidth doesn't work in this case in Firefox?

前端 未结 2 1126
轻奢々
轻奢々 2020-12-21 13:50

I\'m trying to make a simple marquee in Javascript, and need to get the full content width of innerDIV in the following:

2条回答
  •  一向
    一向 (楼主)
    2020-12-21 14:30

    This seems to do the trick:

    docWidth = Math.max(
            Math.max(frameDoc.body.scrollWidth, frameDoc.documentElement.scrollWidth),
            Math.max(frameDoc.body.offsetWidth, frameDoc.documentElement.offsetWidth)                               
    );
    

提交回复
热议问题