This support forum belongs to the Node ScrollIntoView Gallery Module.
Node ScrollIntoView has a bug tracker here: http://github.com/jafl/yui-modules/issues
| Page 1 of 1 | [ 3 posts ] |
|
I couldn't get scrollIntoView() to work, so tried a simplied test. The problem is that it doesn't work either.
The code is very simple: Code: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Example App</title> <style> .one{ height: 1300px; background: red; } .two{ } </style> </head> <body> <h1>test</h1> <div class="one"><span id="someContent">some content</span></div> <div class="two"><a id="link" href="#">Test</a></div> <script src="http://yui.yahooapis.com/3.6.0pr3/build/yui/yui-min.js"></script> <script> YUI().use('gallery-scrollintoview', function (Y) { Y.one('#link').on('click', function(e){ e.preventDefault(); Y.log('hey'); Y.log(Y.one('#someContent')); Y.one('#someContent').scrollIntoView(); }); }); </script> </body> </html> Clicking the link called "test" at the very bottom of the page should scroll the span called "someContent" into view, but for some reason, it doesn't do that at all. Is there something I am doing wrong? I have tested with 3.5.1 and 3.6.0pr3, but couldn't get the scrolling to work. |
|
This example is an edge case because it requires scrolling the body, not some other DOM element. The body element is special, because the viewport height is what matters, not the element's clientHeight. I will upload a patch to the ticket you opened on github.
|
|
Thanks John!
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group