Sha256: af4cec1f434c29b8e5ce45d65c69784a68acc9135d87324401cbb3f6d22f512b
Contents?: true
Size: 432 Bytes
Versions: 13
Compression:
Stored size: 432 Bytes
Contents
#= require partystreusel/namespace Partystreusel.scrollTo = (x, relativeOffset = 0) -> if typeof x == 'object' && !(x instanceof $) # expect this is a hash and link is defined x = $("a[name=#{JSON.stringify(x.link)}]") if typeof x == 'string' x = $(x) if typeof x != 'number' x = x.offset()?.top return false unless x? x = Math.round(x) + relativeOffset $("html,body").animate({scrollTop: x}, 'slow')
Version data entries
13 entries across 13 versions & 1 rubygems