Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mousewheel doesn't working (mCustomScrollbar jQuery plugin)

I'm searching solution for my problem but i can't find it. So I downloaded jQuery plugin (mCustomScrollbar) and everything is fine without one thing - i can't scroll by mousewheel in my test page. Console is clear, examples from author works. I try run my code in latest Firefox and Chrome, but code is not working.

My code:

HTML:

<div id="elements">
    <p>Elementy</p>
    <div id="list">
        xxx<br />xxx<br />
        abc<br />def<br />ghi<br />jkl<br />abc<br />def<br />ghi<br />jkl<br />abc<br />def<br />ghi<br />jkl<br />abc<br />def<br />ghi<br />jkl<br />
    </div>
</div>

JS:

$(document).ready(function(){
    $('div#elements').mCustomScrollbar({
        axis:'y',
        theme:'dark',
        mouseWheel:{
            enable:true,
            scrollAmount:5
        }
    }); 
});

CSS:

div#elements {
    background-color:#fff;
    border:1px solid #000;
    height:350px;
    position:absolute;
    right:10%;
    top:20%;
    width:230px;
    z-index:2;
}
div#elements p {
    border-bottom:1px solid #000;
    cursor:default;
    margin:0;
    padding:8px 0;
    text-align:center;
}

If anyone can help me i will waiting for message.

like image 372
user242302 Avatar asked Jun 10 '14 18:06

user242302


1 Answers

Okay, i find solution. So i must using concat version of code.

Then you will use http://malihu.github.io/custom-scrollbar/jquery.mCustomScrollbar.concat.min.js, but not http://malihu.github.io/custom-scrollbar/jquery.mCustomScrollbar.min.js. It's stupid but it works.

Regards

like image 79
user242302 Avatar answered Nov 15 '22 01:11

user242302