jquery - typist.js while lines expanding the page scrolling bottom

标签 jquery css

在我的第一页中,我使用了一个启动序列 typist.js插入。但是我的行在填满页面后正在扩展,但问题是滚动条站在它的顶部而不是按照顺序。为此,我尝试添加:

.on('type.typist', function() {
    window.scrollTo(0, $(document).height());
});

底部代码上的顶部代码。但即使页面上没有显示这些行,它也不起作用。

jQuery(function($) {
    $('.typist').typist({ speed: 150 })
                .typistPause(1)
                .typistAdd('[!]:./action.SYSTEM.BOOT\n')
                .typistPause(1)
                .typistAdd('\n')
                .typistPause(1)
                .typistAdd('[!]:./initiating.DEBUG.MODE\n')
});

那么解决方案是什么?感谢您的帮助。

这是我的最后更新:http://jsfiddle.net/kodbilenadam/eb48gybv/

最佳答案

查看源代码以及如何 typist "Dialog" demoprintPhrase() 函数中执行。添加新对话行后,它调用 jQuery animate()将文档的 body 元素向下移动:

$('body').animate({
    scrollTop: $(document).height()
}, 'slow');

关于jquery - typist.js while lines expanding the page scrolling bottom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31912860/

相关文章:

jquery - 使用 toggleClass 使用 JQuery 切换 CSS 动画

css - 如何在 div 上应用背景透明度(对于 AJAX 加载动画)?

javascript - 使用 JQuery 切换 Attr

php - 删除未关闭的 html 标签 - 同时将内容粘贴到带有 contenteditable 的 div

javascript - 优化 Jquery 代码 - 单击时添加和删除类

javascript - offsetLeft Javascript 属性需要更多时间

jquery - 在流体布局上尝试使用 Jquery 等高列 - 文本溢出。 :(

html - 使绝对位置在移动设备上可滚动

css - 当我的页面落在 col-md 的断点内时,如何设置我的导航栏折叠?

javascript - Javascript/JQuery 中的本地人与 Rails 中的本地人一样吗?