0

I am using nicescroll jquery plugin. http://areaaperta.com/nicescroll/ I am getting Unwanted horizontal scroll bar. By doing this horizrailenabled:false, it disappears but it did not come after re-sizing the window. It disables on re-sizing also which I don't want. I tried with all my css also that may cause horizontal bar appear but nothing happens as I want. I am guessing it might be due to width issue. But not able to figure it out.

How do I make this horizontal bar disappear?

My code is so far as below:

    <style>
body {
    margin:0;
    padding:0;
    color:#000;
    background:#FFFFFF;
    letter-spacing:0.5px;
    overflow-x:hidden;
}
        .wrap{
            background-color: #087877;
            height: 100%;
            overflow: hidden;
            position: relative;
            width:100% !important;
        }
        #scrollingContent{
            padding-left: 149px;
            padding-top: 136px;
        }
        #mainContent {
            position:absolute;
            padding:0;
            top:0;
            left:0;
            width:100%;
            height:100%;
            font-family:mainFont;
            color:#FFF;
            overflow:hidden;
        }
    .contactHeader{
        color: white;
        font: 100 52px/60px 'TitilliumText25L1wt',Arial,sans-serif;
        height: 125px;
        left: 144px;
        letter-spacing: 0;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 10;
        background-color: #178895;
        line-height: 142px;
    }
        </style>

        <div id="mainContent">
            <div id="newsWrapper" class="wrap">
                <div id="scrollingContent">
                <div class="newsHeader">news</div>
                                                           //content
               </div>
            </div> 
        </div>

        <script type="text/javascript">
             $("#newsWrapper").niceScroll({touchbehavior:false,cursorborder:"0px solid #fff",cursorcolor:"#E1F3FF",cursoropacitymax:0.2,cursorborderradius:0,bouncescroll:true,scrollspeed:100, cursorwidth:15,autohidemode:false,zindex:10});
             $("#newsWrapper").getNiceScroll().onResize()
        </script>
kiran
  • 641
  • 2
  • 12
  • 34

2 Answers2

0

to avoid unwanted scrolling add css .To avoid unwanted scrolling in your body tag do like this.

body{
overflow-x: hidden;  /*avoiding horizontal scrolling*/
}
user3386779
  • 6,883
  • 20
  • 66
  • 134
0

You can use :

$("#newsWrapper").niceScroll({horizrailenabled:false});

For more info: https://github.com/inuyaksa/jquery.nicescroll/issues/114

Hiral Vadodaria
  • 19,158
  • 5
  • 39
  • 56