Scroll and focus to field

Joined
Dec 16, 2022
Messages
4
Reaction score
0
Hi, could you help me? From https://spazioweb.w3spaces.com/scroll_and_focus.htm I'm trying to scroll and focus to "N. inventario".
I have this script to focus the field, but I would like it to autoscroll about 2 cm above the position to which it leads:

focusme = document.querySelector('#DetailsOpen_Array04 > div > label:nth-child(2) > input');
focusme.focus();

I found https://gist.github.com/psdtohtml5/6215547googling, but I can't apply it to my case...
Thank you very much!
 
Hi, could you help me? From this page I'm trying to scroll and focus to "N. inventario".
I have this script to focus the field, but I would like it to autoscroll about 2 cm above the position to which it leads:

focusme = document.querySelector('#DetailsOpen_Array04 > div > label:nth-child(2) > input');
focusme.focus();

I found this googling, but I can't apply it to my case...
Thank you very much!
Hey

I tried opening the reference page

Code:
https://spazioweb.w3spaces.com/scroll_and_focus.htm

but I get a 404.

If you show me the page, I can probably help to get the problem solved.

Let me know! :)
 
Hey

I tried opening the reference page

Code:
https://spazioweb.w3spaces.com/scroll_and_focus.htm

but I get a 404.

If you show me the page, I can probably help to get the problem solved.

Let me know! :)

Sorry, BlurryBit, this is the page (focus.html), link https://filetransfer.io/data-package/EOWVI0QH#link
 
Back
Top