>>>return typeof loWindow.pageYOffset != 'undefined' ? loWindow.pageYOffset: document.documentElement.scrollTop? >>> document.documentElement.scrollTop: document.body.scrollTop? document.body.scrollTop:0 >>>
if (typeof loWindow.pageYOffset != 'undefined') { >> return loWindow.pageYOffset; >> } >> if (document.documentElement.scrollTop) { >> return document.documentElement.scrollTop; >> } >> return 0;>
> function PositionTop() > { > lnOffset=0 > loWindow=window.parent.oParent > if (loWindow.pageYOffset) > { > lnOffset=loWindow.document.documentElement.scrollTop > } > else > { > lnOffset=loWindow.document.body.scrollTop > } > return lnOffset > } >My code is functionally identical to the original. Yours is not : If pageYOffset is available you are returning scrolltop rather than pageYOffset.