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 可滚动文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
ExecJS::ProgramError: SyntaxError: Reserved word quot;functionquot;(ExecJS::ProgramError: SyntaxError: 保留字“function)
Infinite scroll and will_paginate appending the #39;next page#39; of items multiple times(无限滚动和 will_paginate 多次附加项目的“下一页)
What is cleanest way to turn Array of JQuery Promises into a JQuery Promise of an Array?(将 JQuery Promise 数组转换为数组的 JQuery Promise 的最简洁方法是什么?)