Closed T-M-C closed 11 years ago
Try doing a console.log of x, and more importantly: this and this.bbUIscrollWrapper directly before you call this.bbUIscrollWrapper.scrollTop and see what those reveal.
thank you...but i never call "this.bbUIscrollWrapper.scrollTop", i am calling:
document.getElementById('myScreen').scrollTo(100,0);
or
var element = document.getElementById('myitem'); document.getElementById('myScreen').scrollToElement(element);
neither of them works...
Try a console.log(document.getElementById('myScreen')) just before calling your .scrollTo(). If your console shows undefined, the problem will be there. If not, what type of element are you getting by id? Sceen, Scroll Panel, etc.?
Is the error still there if you update to bbUI.js version 0.9.6.889?
i try to scroll a screen (used it with no problems before)... bbui is 0.9.6.889, console.log(document.getElementById('myScreen')) gives my screen div correctly.
console.log(document.getElementById('screenbg'))
<div data-bb-type="screen" ....>...</div>
document.getElementById('screenbg').scrollTo(1,0);
TypeError: 'undefined' is not an object (evaluating 'this.bbUIscrollWrapper.scrollTop=e')
thanks for your help
any chance to get that fixed @tneil ?
I've just tested both functions with the latest and they are working fine for me. When are you calling your document.getElementByID()??? if you are calling it during the onscreenready it will return undefined because the screen has not yet been inserted into the dom. You would have to call this in the ondomready event to ensure that your screen is actually in the DOM of the page
i did it after inserted in the dom... just tried it via console:
document.getElementById('screenbg').scrollTo(1,0); TypeError: 'undefined' is not an object (evaluating 'this.bbUIscrollWrapper.scrollTop = x')
newest bbui...
I can't reproduce the issue here.. everytime I call it, it works without error
i just tried it in the bbui samples... and it works there. sorry! can´t find my problem.... :-(
any tip where i can look?
Hmm... what if you don't turn off the data-bb-scroll-effect??
works now! rebuild my index.html from scratch... must be a typo or something like this, cant say exactly... sorry tim!
Hi,
the .scrollTo() function stops working for me. getting this error in console:
TypeError: 'undefined' is not an object (evaluating 'this.bbUIscrollWrapper.scrollTop = x')
bbui v0.9.6.866 / tested on simulator 10.2.0.1443 and DAC 10.2.0.1761