I forgot an important piece of information. It seems to work perfectly fine with Safari 3.2.1 on MacOSX but not on Firefox 3.0.10 on the same OS (which isn't that bad after all, but I figured I'd let you know).
On May 5, 10:36 am, Bertrand <[email protected]> wrote: > Hi, > > I was working with it and it doesn't seem to work at all. It returns > 36 all the time for some reason as the viewport height, which clearly > isn't the case. > Are there known issues with this method? > > The code is the following: > > <html> > <head> > <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/ > prototype.js"></script> > <script type="text/javascript"> > document.observe('dom:loaded', function(){ > $('bang').observe('click', function(){ > alert('cumulativeOffset (left, top): ' + > $('foo').cumulativeOffset() > + '\n' + > 'viewportDimensions (width, height): ' + > document.viewport.getDimensions().width + ', ' + > document.viewport.getDimensions().height); > });}); > > </script> > </head> > <body> > <input id="bang" type="button" value="test!"/> > <div id="foo" style="border:2px solid red; position:absolute; top: > 1000px; left:1000px"> > Test > </div> > </body> > </html> > > Any help appreciated. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
