.find(this.selector)
.map(function () {
var href = $(this).attr('href')
- return /^#\w/.test(href)
- && $(href).length
- && [[ $(href).position().top, href ]]
+ , $href = /^#\w/.test(href) && $(href)
+ return $href
+ && href.length
+ && [[ $href.position().top, href ]]
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
.find(this.selector)
.map(function () {
var href = $(this).attr('href')
- return /^#\w/.test(href)
- && $(href).length
- && [[ $(href).position().top, href ]]
+ , $href = /^#\w/.test(href) && $(href)
+ return $href
+ && href.length
+ && [[ $href.position().top, href ]]
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {