jQuery-slimScroll icon indicating copy to clipboard operation
jQuery-slimScroll copied to clipboard

slim scroll adds inline width attribute to target div

Open r3wt opened this issue 10 years ago • 1 comments

breaks the layout:

img

bindings are as follows

$.jqMVC
.bind('slimscroll',function(){
    $('.scroll').each(function(){
        $(this)
        .slimScroll({destroy: true})
        .slimScroll({
            height: $(this).css('height'),
            alwaysVisible:true,
            railVisible: true,
            railColor: '#222',
            railOpacity: 0.3,
            distance:'0'
        });
    });
})

it would appear the plugin is aimed at the low hanging fruit of developers, but for properly designed css/html layout it breaks badly.

r3wt avatar Dec 24 '15 03:12 r3wt

If your div (can't see from the snapshot) is a block element then width: auto will have the same effect as width 100%. You can also take a look at the documentation: http://rocha.la/jQuery-slimScroll.

width - Width in pixels of the visible scroll area. Stretch-to-parent if not set. Default: none.

The 'default' part is actually not true as slimscroll() passes width: auto by default instead.

geogkary avatar Feb 14 '16 10:02 geogkary