jstoudt / enscroll

A jQuery plugin for custom scrollbars
http://enscrollplugin.com
Other
73 stars 46 forks source link

Doesn't work on jQuery 3.1.1? #70

Closed lautiamkok closed 7 years ago

lautiamkok commented 7 years ago

I use jQuery 3.1.1 and enscroll doesn't work with it.

My code:

<div id="bodyDiv">
        <div id="scrollbox3">
            <h1>New Scrolling Window</h1>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam a justo erat, volutpat hendrerit dolor. Sed urna nibh, dapibus at egestas non, vulputate ut quam. Morbi a erat tristique tellus varius venenatis. Aenean lacinia sem eget turpis fringilla commodo. Sed lorem nisi, viverra a interdum nec, varius eu enim. Donec ornare, nunc quis eleifend iaculis, nulla eros mollis tellus, quis faucibus risus odio non lectus. Maecenas ac velit non metus rhoncus commodo. Nunc ligula est, ultricies sed mattis sed, dapibus at arcu. Maecenas lacinia nisl ut sem bibendum ac condimentum purus facilisis. Curabitur ut nibh lobortis libero interdum vehicula vel quis nulla.</p>

            <p>Suspendisse et massa urna. Donec eu lorem nec felis dapibus aliquam viverra in quam. Suspendisse ultrices, nisi ac venenatis porttitor, erat turpis dapibus augue, sed rutrum nunc ante sed enim. Aliquam et tempus mi. Nullam malesuada, nunc a eleifend pretium, justo lorem tempus justo, id adipiscing dolor ipsum sed velit. Maecenas odio massa, feugiat vel sodales ut, placerat at quam. Cras viverra diam vitae diam elementum vitae aliquet erat tincidunt. Quisque fringilla neque in lacus tempor cursus. Curabitur eget nulla et nisi dignissim tempor vel non risus. Mauris ac ipsum metus, a auctor massa. Nunc eros ante, ullamcorper a mollis nec, aliquam sed est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
        </div>
    </div>

    <style type="text/css">
        #bodyDiv {
            position:absolute;
            top:0px;
            bottom:0px;
            left:0px;
            right:0px;
            z-index: 9999;
            border: 2px solid black;

        }
        #scrollbox3 {
            overflow: auto;
            width: 400px;
            height: 300px;
            padding: 0 5px;
            border: 1px solid #b7b7b7;
        }

        .track3 {
            width: 10px;
            background: rgba(0, 0, 0, 0);
            margin-right: 2px;
            border-radius: 10px;
            -webkit-transition: background 250ms linear;
            transition: background 250ms linear;
        }

        .track3:hover,
        .track3.dragging {
            background: #d9d9d9;
            background: rgba(0, 0, 0, 0.15);
        }

        .handle3 {
            width: 7px;
            right: 0;
            background: #999;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 7px;
            -webkit-transition: width 250ms;
            transition: width 250ms;
        }

        .track3:hover .handle3,
        .track3.dragging .handle3 {
            width: 10px;
        }
    </style>

    <script type="text/javascript">

        $('#scrollbox3').enscroll({
            showOnHover: true,
            verticalTrackClass: 'track3',
            verticalHandleClass: 'handle3'
        });

    </script>

You can see it on jsfiddle.

MohammadAlBanna commented 7 years ago

I've just released a fix and tested in my app. Thanks for the developers of such a great library.