Open sbergandy opened 10 years ago
The function getBrowserScrollbarWidth() calculates wrong result if we apply nanoscroller to some div which is placed in iframe. I fixed the issue by adding parent before each document like this:
getBrowserScrollbarWidth()
getBrowserScrollbarWidth = function() { var outer, outerStyle, scrollbarWidth; outer = parent.document.createElement('div'); outerStyle = outer.style; outerStyle.position = 'absolute'; outerStyle.width = '100px'; outerStyle.height = '100px'; outerStyle.overflow = SCROLL; outerStyle.top = '-9999px'; parent.document.body.appendChild(outer); scrollbarWidth = outer.offsetWidth - outer.clientWidth; parent.document.body.removeChild(outer); return scrollbarWidth; };
But I have only one iframe layer. For more it could still be a problem.
+1
+1 It works fine in Chrome, but in IE it fails to calculate the scrollbar width
The function
getBrowserScrollbarWidth()
calculates wrong result if we apply nanoscroller to some div which is placed in iframe. I fixed the issue by adding parent before each document like this:But I have only one iframe layer. For more it could still be a problem.