I'm trying to scroll to the bottom of a div which contains a list messages.
var element = document.getElementById("Cntr_messages");
element.scrollTop = element.scrollHeight;
as expected the name of the Div is Cntr_messages.
I noticed since i'm using a webblock that the divs id gets a prefix which is #b23-Cntr_Messages in this case.
i tried implementing the JS using the prefix and Div id and only the div ID. neither of these options work.
i would greatly appreciate any tips or tricks you guys could provide.
Yours, Jan
Hi Jan,
I would use the ScrollToElement action from OutSystemsUI:
Kind Regards,João
Thanks for the quick reply!i tried implementing your second suggestion and got this error.
You are getting this error because you are running some Javascript too early. JS is running but DOM is yet to be loaded. Place the JS at the bottom of the page.
Inspect the page in the browser and check the error at the console that would help you to find the cause.
Regards,
Rahul
Hey Jan,
You could pass as input parameter to your JavaScript code the container id
That is available in any client action that you might be using.
Regards,Bogdan
Hello jan,
your are getting that error because you container id may be in closed in the if condition of output
if OutSystems checking that container that run time its may be getting in true but as programmatically was not there
better put the container without if condition or create new container below if and pass the id of that for the scrolling purpose Thanks and Regards,
Akshay Deshpande
Above post related to this reply..(clarification)