Using javascript in a pure HTML file, the image can move with the screen normally, but the same javascript code has no response in the asp.net page, and the image cannot move with the screen.
main reason:
In asp.net pages, use the following criteria:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http ://www.w3.org/1999/xhtml " >
This will cause document.body.scrollTop to always be equal to 0.
Solution:
Change document.body.scrollTop to document.documentElement.scrollTop to return to normal.