javascript - Rails4: "scrollTop" doesn't work every other click -
javascript - Rails4: "scrollTop" doesn't work every other click -
scrolltop
doesn't work every other click (every sec click).
i utilize will_paginate
@ bottom of page.
when click on link, page refreshed , display position @ bottom of page. click on link page, page refreshed , display position @ top of page expect.
for example, when click link page 2, page 2 displayed display position remains @ bottom. when click link page 5, page 5 displayed , display position @ top expect. when click link page 6, page 6 displayed display position remains @ bottom. when click link page 8, page 8 displayed , display position @ top expect. ...
i have tried followings, had same result.
\assets\javascripts\calendars.js.coffee
$('html, body').animate({ scrolltop: 0 }, 'slow')
$('body').animate({ scrolltop: 0 }, 'slow')
$('html, body').scrolltop()
$(document).scrolltop()
$(window).scrolltop()
$(window).scrolltop(0)
\views\calendars\index.html.erb
... <%= will_paginate @calendar %> ...
how should edit code?
javascript jquery ruby-on-rails ruby-on-rails-4 coffeescript
Comments
Post a Comment