B4J Question [ABMaterial] Anchor Tag

PCastagnetti

Member
Licensed User
Longtime User
Assuming you have a very long page, I was wondering if you could move to a specific location on the page (perhaps using an Anchor Tag?)
I tried it with page.CurrentRow command, but I did not get any results

Thank you
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
CurrentRow should actually be hidden. It's an internal variable.

You could use something like this in the ConnectPage() method after page.FinishedLoading:

B4X:
...
Dim img As ABMImage
img.Initialize(page, "img", "../images/alainbailleul.png", 1)   
page.Cell(6,1).AddComponent(img)
...
page.Refresh ' IMPORTANT!
page.FinishedLoading 'IMPORTANT 

Dim script As String = $"$("body").animate({ scrollTop: $('#${img.ID}').offset().top }, 1000);"$  ' <-- scroll animated to img.ID
page.ws.Eval(script, Null)
page.ws.Flush ' IMPORTANT
 
Upvote 0
Top