开发者

Append URLs with #content

开发者 https://www.devze.com 2022-12-14 10:20 出处:网络
I am trying to customize a photo gallery in Squarespace.A test gallery can be found here - http://dzrtgrls.squarespace.com/gallery/test-2/4011897 .What I wou开发者_如何学Pythonld like is to have the n

I am trying to customize a photo gallery in Squarespace. A test gallery can be found here - http://dzrtgrls.squarespace.com/gallery/test-2/4011897 . What I wou开发者_如何学Pythonld like is to have the next or previous images load so that the prev - / + next navigation is at the top of the browser window. So it seems I need to somehow append each url with #content so the content div is at the top of the window whenever the previous or next links are used. Is there a way to do this with javascript or jquery?


Do you mean you want to make the content div scroll so that it's at the top of the page? You can do that with scrollIntoView:

document.getElementById('content').scrollIntoView();
0

精彩评论

暂无评论...
验证码 换一张
取 消