div jspContainer内部缺少jspVerticalBar [英] div jspVerticalBar missing inside the jspContainer

查看:86
本文介绍了div jspContainer内部缺少jspVerticalBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我当前的Web项目中,我试图使用名为 jScrollPane 的库来更改滚动条./p>

该脚本将应用并生成jspContainer,但div jspVerticalBar ist丢失.首先,我认为该脚本在用.load加载时会出现问题.但是我将脚本标签放在正在加载的view.html中.

另一个问题是,当我转到另一个视图并返回首页时,脚本生成了错误的容器宽度. Is是如此之小,以至于容器的内容被溢出隐藏了.

有人知道为什么会这样吗?我做错什么了吗?你能帮我这个忙吗?

以下是您可能需要的所有信息:

@import url("sbar.css"); /*in main.css*/

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/vendor/mwheel.js"></script>
<script src="js/vendor/jscrollpane.js"></script>
<script src="js/main.js"></script>

<script>
$(document).ready(function() {
    $(".scroll-pane").jScrollPane(); // in startseite.html
});
</script>

实时示例:链接

解决方案

我知道我为时已晚,但是我以为像我这样的人来这里只是为了找到问题的答案,可能会得到一些答案.帮助

检查点:

  1. 容器的宽度必须固定(或至少为最大宽度)
  2. 容器的高度必须固定(以像素为单位,例如200px,250px)
  3. 容器必须有溢出:自动; (或至少是overflow-x:隐藏; overflow-y:自动;)
  4. 必须在不应用jScrollPane的情况下出现常规滚动条

    重要

  5. 如果仍然无法解决该问题,那么这里是一个附加检查点:
    ?您是否将内容动态添加到应用了jScrollPane的容器中?
    如果以上问题的答案为是,则请考虑jScrollPane的reinitialise()api,并在动态添加内容之后使用它.
    上面提到的API对于SPA非常有用
    有关更多信息和示例,请访问: http://jscrollpane.kelvinluck.com/dynamic_content.html

In my current web project Im trying to change the scrollbar with a lib called jScrollPane.

The script applies and generates the jspContainer, but the div jspVerticalBar ist missing. First I thought the script got problems when its loaded in with .load. But I placed the script tag in the view.html that is getting loaded in.

Another problem is when I go to another view and return to the front page, the script generates a wrong width of the container. Is is so small that the content of the container gets invisible by the overflow:hidden.

Does anyone got an idea why this happens? Did I do something wrong? Can you please help me out with this?

Here are all informations you may need:

@import url("sbar.css"); /*in main.css*/

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/vendor/mwheel.js"></script>
<script src="js/vendor/jscrollpane.js"></script>
<script src="js/main.js"></script>

<script>
$(document).ready(function() {
    $(".scroll-pane").jScrollPane(); // in startseite.html
});
</script>

The live example: Link

解决方案

I know I am too late to reply, but just thought that other people like me, who came here just to find the answer to the question, might get some help

Checkpoints:

  1. the container must have a fixed width (or at least a maximum width)
  2. the container must have a fixed height (in pixel, e.g., 200px, 250px)
  3. the container must have overflow:auto; (or at least overflow-x:hidden;overflow-y:auto;)
  4. a regular scrollbar must appear without applying jScrollPane

    Important

  5. In case you still cannot fix the issue, then here is one additional checkpoint:
    ? Are you adding contents dynamically to your container on which jScrollPane is applied?
    If the answer to above question is yes, then please consider the reinitialise() api of jScrollPane and use it after dynamically adding the content.
    The above mentioned api is very useful for a SPA
    For more information and example, please visit: http://jscrollpane.kelvinluck.com/dynamic_content.html

这篇关于div jspContainer内部缺少jspVerticalBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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