Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jquery.pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ function pjax(options) {
var scrollTo = options.scrollTo

// Ensure browser scrolls to the element referenced by the URL anchor
if (hash) {
var name = decodeURIComponent(hash.slice(1))
if (url.hash) {
var name = decodeURIComponent(url.hash.slice(1))
var target = document.getElementById(name) || document.getElementsByName(name)[0]
if (target) scrollTo = $(target).offset().top
}
Expand Down