JQuery 可滚动文本

JQuery Scrollable Text(JQuery 可滚动文本)
本文介绍了JQuery 可滚动文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个将文本绑定到可滚动框内的 jquery 插件.大多数滚动插件都在转换浏览器滚动条,但我想保持原样并且可用.这只是为了在小空间中包含大量文本.

I'm searching for a jquery plugin that will bound text inside a scrollable box. Most of the scroll plugins are converting the browser scroll bar but I want to keep that as it is and usuable. This is just to contain a large amount of text in a small space.

就像这样 页面 在最底部它们包含一个一个小的可滚动框中的大量文本.我试图实现这个插件,但我对 JQuery 有点陌生,所以微不足道的指令不足以让我站起来.如果我可以使用这个插件来做我想做的事,这段代码对吗?:

It's like this page where at the very bottom they are containing a large amount of text in a small scrollable box. I tried to implement this plugin but I'm kinda new to JQuery so the meager instructions weren't enough for me to get off my feet. If I can use this plugin to do what I want, is this code right?:

<script>
$(document).ready(function(e) {
    $(".Information").uscrollbar();
});
</script>

<div id="Hotel" class="Information">
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
        <p>blah</p>
    </div>

推荐答案

你真的不需要 jQuery.只是一些 CSS.

You really don't need jQuery for this. Just some CSS.

.Information{
height:100px;
overflow:auto;
}

如果您确实需要此插件,请确保您正确引用了 jQuery 以及指向插件 js 文件的链接.

If you have a genuine need for this plugin then make sure you're referencing jQuery correctly and the link to the plugin js file.

如果您在浏览器中运行该页面,您是否会在控制台窗口中看到任何内容.任何错误.

If you run the page in your browser do you get anything in the console window. Any errors.

添加了 JSFiddle

还要确保您引用了所需的资产:

Also be sure you're referencing the required assets:

jquery.uscrollbar.js
jquery.uscrollbar.css

这篇关于JQuery 可滚动文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

how to remove this error quot;Response must contain an array at quot; . quot;.quot; while making dropdown(如何删除此错误quot;响应必须在quot;处包含数组。创建下拉菜单时(Q;))
Why is it necessary to use `document.createElementNS` when adding `svg` tags to an HTML document via JS?(为什么在通过JS为一个HTML文档添加`svg`标签时,需要使用`Document.createElementNS`?)
wkhtmltopdf print-media-type uses @media print ONLY and ignores the rest(Wkhtmltopdf print-media-type仅使用@media print,而忽略其余内容)
How to trim() white spaces from a string?(如何从字符串中去掉()空格?)
price depend on selection of radio input(价格取决于无线电输入的选择)
calculate price depend on selection without button(根据没有按钮的选择计算价格)