开发者

Append URLs with #content

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜