Below is a sample of calling scrollTo on a canvas. Scroll down to where the button is. Click on the button. I expect it to scroll back to the top but it does not. What am I missing?
Code:
isc.HLayout.create({
ID: "hLayoutAlignCenter",
autoDraw: true,
// Specifying the width creates space within which to
// center the members.
width: "100%",
height: 700,
layoutMargin: 6,
membersMargin: 6,
border: "1px dashed blue",
align: "center", // As promised!
members: [
isc.VLayout.create({
height: 1200,
width: 40,
backgroundColor: "red",
members:[isc.LayoutSpacer.create({height:"90%"}),isc.Button.create({click:function(){hLayoutAlignCenter.scrollTo(0,0);} })]
})
]
});
Comment