我正在尝试使用jquery获得时尚的滚动条,这是有问题的. [英] I am trying to get a stylish scroll using jquery it is having a problem.

查看:75
本文介绍了我正在尝试使用jquery获得时尚的滚动条,这是有问题的.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我正在使用div,并且当div内容溢出时,我正在使用从jquery获取的滚动条,因此使用了以下代码....

Hi!! I am using a div and when div contents overflow i am using a scroll which we get from jquery i have used following code for it....

<script src="js/jquery.mousewheel.js" type="text/javascript"></script>
<script src="js/jquery.jscrollpane.min.js" type="text/javascript"></script>



然后对于CSS:



then for css :

<link href="css/jquery.jscrollpane.css" rel="stylesheet" type="text/css" />




当我单击一个按钮时,div会打开并第一次滚动,但是当我第二次单击它时,div的大小会从250px扩大到855px ...所以想要...我们帮助您解决此问题... jQuery如下....





when i click on a button the div opens and scroll works for first time but when i click on it second time the size of div enlarges from 250px to 855px... so wanted... ur help to resolve the issue... the jquery is as follows....


function scrollstyle()
{
    $(function()
    {
        $('.scroll-pane').each(
            function()
            {
                $(this).jScrollPane(
                    {
                        showArrows: $(this).is('.arrow')
                    }
                );
                var api = $(this).data('jsp');
                var throttleTimeout;
                $(window).bind(
                    'resize',
                    function()
                    {
                        if ($.browser.msie) {
                            if (!throttleTimeout) {
                                throttleTimeout = setTimeout(
                                    function()
                                    {
                                        api.reinitialise();
                                        throttleTimeout = null;
                                    },
                                    50
                                );
                            }
                        } else {
                            api.reinitialise();
                        }
                    }
                );
            }
        )
    });
}




绑定div之后,我要调用的函数... HTML中的div如下:




this function i am calling after binding the div... and div in HTML is as follows:

<div id="divshowcomments" style="display: none; width: 250px; height: 435px; border: 1px solid #353535;
      border-radius: 7px; position: relative; background-color: grey; top: -480px;
      left: 160px;overflow:auto;" class="scroll-pane"  runat="server">
  </div>




那么请问一下btn第二次单击时为什么div扩大的原因可以帮我吗?

预先感谢您.....




so can u please help me as to why the div is expanding when btn clicked second time...

Thanking You in advance.....

推荐答案

(function() {
(function() {


(' .scroll-pane').每个( 功能() {
('.scroll-pane').each( function() {


( this ).jScrollPane( { showArrows:
(this).jScrollPane( { showArrows:


这篇关于我正在尝试使用jquery获得时尚的滚动条,这是有问题的.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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