jQuery mCustomScrollbar “scrollTo"不工作 [英] jQuery mCustomScrollbar "scrollTo" not working

查看:35
本文介绍了jQuery mCustomScrollbar “scrollTo"不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 mCustomScrollbar 的基本设置,它运行良好,除非我调用以下内容:

I'm using a basic setup for mCustomScrollbar which is working great except when I call the following:

jQuery("#mcs_container").mCustomScrollbar("scrollTo","top");

什么都没发生.firebug 中没有显示错误,它什么也不做.有没有人以前经历过这种情况,或者有没有人知道为什么会发生这种情况?

Nothing happens. There is not error shown in firebug, it just does nothing. Has anyone experienced this before or does anyone have any idea why this might be happening?

谢谢!

推荐答案

MCustomScrollbar 不提供滚动到页面顶部的功能.但是,它确实支持滚动到 HTML 中的特定元素.

MCustomScrollbar doesn't provide feature of scrolling to top of the page. However, it does support scrolling to specific element in HTML.

例如,如果我有一个 id 为logout"的元素位于页面顶部,我需要在顶部滚动,然后写

For example, if I have an element with id "logout" which is at top of the page and i need to scroll at top, then write

$("#mcs_container").mCustomScrollbar("scrollTo", "#logout");

希望你觉得这有用.

干杯!

这篇关于jQuery mCustomScrollbar “scrollTo"不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆