Sha256: 04f4a2507b02eb316ba067f4894c4527628aba835ab64da5fbc2b4a8ab48e17b

Contents?: true

Size: 516 Bytes

Versions: 13

Compression:

Stored size: 516 Bytes

Contents

slide_to_top = () ->

  pos = $(window).scrollTop()

  if pos > 100
    $('.toplink').addClass('active')

  $(window).scroll ->
    if $(this).scrollTop() > 100
      $('.toplink').addClass('active')
    else
      $('.toplink').removeClass('active')

  $('.toplink').click ->
    $('html, body').stop().animate { scrollTop: 0 }, 500,'swing', ->
      $('.toplink').removeClass('active')
      return false
    return false

$(window).on 'load', ->
  slide_to_top()

$(document).bind "page:load", ->
  slide_to_top()

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hancock_cms-2.0.1.3 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.2.3 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-2.0.1.2 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-2.0.1.1 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.2.2 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.1 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-2.0.0.2 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.0.4 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.0.3 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-2.0.0.1 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.0.2 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-2.0.0 app/assets/javascripts/hancock/app/back_to_top.coffee
hancock_cms-1.0.0 app/assets/javascripts/hancock/app/back_to_top.coffee