Animate Height Bottom to Top Instead of Top to Bottom

强颜欢笑 提交于 2019-12-02 02:07:43

You div and your a tags have the same ID. They must have unique IDs.

$('a#line-1').click(function() {
    $('div#line-1').animate({

needs to be something like:

$('a#line-1').click(function() {
    $('div#unique_id').animate({

Example Fix

position: absolute;
bottom: 0px;

animate bottom + 1.

You can also use negative values for top or margin-top to move upwards.

Animate as you would for top-to-bottom, but add element.scrollTop = 99999;

This will ensure that the bottom of the content is visible (unless for some reason it's 100,000 pixels tall) and the effect will be bottom-to-top animation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!