Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个位置固定的网站,并且我的 div 配置非常不正统。页面的当前大小是 1450 x 900。我想要做的是以某种方式使页面加载的起点不同于 top:0; 左:0。因此,假设您在浏览器中的分辨率为 1024 x 768,我希望页面以这样一种方式加载,即您看不到前 1024 像素(在 1450 中)和前 768 像素(在900),而是说宽度为 300-1324 像素,高度为 100-868 像素。
我希望您理解我要描述的内容,如果没有,请向我寻求澄清。
任何帮助深表感谢!先感谢您。
使用 javascript:
var xcoord = 100, ycoord = 300; window.scroll(xcoord, ycoord);
坐标是您希望加载浏览器窗口左上角的位置。