Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML jQuery JQueryUI
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>
 
then for css :
 
    <link href="css/jquery.jscrollpane.css" rel="stylesheet" type="text/css" />
 

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();
                        }
                    }
                );
            }
        )
    });
}
 

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>
 

so can u please help me as to why the div is expanding when btn clicked second time...
 
Thanking You in advance.....
Posted 4-Sep-12 22:35pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Is there any jquery Code other than this one
  Permalink  
Comments
Shruthi.BT at 5-Sep-12 8:19am
   
ya... used... a different js for it it workks sometimes sometimes it does not... link of it is...
 
http://areaaperta.com/nicescroll/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 235
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 5 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100