jeffreyhi1 / jscrollpane

Automatically exported from code.google.com/p/jscrollpane
0 stars 0 forks source link

Arrow Grouping #211

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is not a defect but a feature request. I also include my example for 
reference.  :)

A site I'm working on has the design requirement of grouping the arrow buttons 
on the bottom like the default on OS X which unfortunately the plugin doesn't 
support. So I updated jScrollPane-1.2.3.js specifically changing

if (settings.arrowSize) {
    trackHeight = paneHeight - settings.arrowSize - settings.arrowSize;
    $track
        .css({'height': trackHeight+'px', top:settings.arrowSize+'px'})
} else {
    var topArrowHeight = $upArrow.height();
    settings.arrowSize = topArrowHeight;
    trackHeight = paneHeight - topArrowHeight - $downArrow.height();
    $track
        .css({'height': trackHeight+'px', top:topArrowHeight+'px'})
}

at line 214 to

if (settings.arrowSize) {
    trackHeight = paneHeight - settings.arrowSize - settings.arrowSize;
} else {
    settings.arrowSize = $upArrow.height();
    trackHeight = paneHeight - settings.arrowSize - $downArrow.height();
}
if(settings.arrowGroup)
{
    if(settings.arrowGroup == 'top')
    {
        $track
            .css({'height': trackHeight+'px', top:(settings.arrowSize * 2) + 'px'})
    }
    else
    {
        $track
            .css({'height': trackHeight+'px', top:'0'})
    }
}
else
{
    $track
        .css({'height': trackHeight+'px', top:settings.arrowSize + 'px'})
}

I also added "arrowGroup : null," to the $.fn.jScrollPane.defaults object.

I love to see this as a default part of the code with the addition of a 
specific option to set arrowGroup to "OS" so that it will use the default arrow 
grouping for the specific operating system.

I have attached my modified files in case anyone else would like to try them. I 
give no warranty as to their fitness for your task. They are not extensively 
tested but are working for me currently.

And Kelvin, thanks so much for creating this plugin. I played with jQueryUI 
Slider but it's such a monster pain in the butt when all I need is a skinable 
scroller.  :D

Original issue reported on code.google.com by Rune...@gmail.com on 3 Aug 2010 at 7:18

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the feature request and example code... I'm currently working on a 
rewrite of jScrollPane and I'll consider if this functionality can be added.

Original comment by kelvin.l...@gmail.com on 3 Aug 2010 at 9:39

GoogleCodeExporter commented 9 years ago
I have just announced the beta of a completely rewritten version of jScrollPane:

http://groups.google.com/group/jscrollpane/browse_thread/thread/c1bc1bf63e3f80d8

I have added the ability to choose where the arrows appear in the new version 
and some examples showing it in action.

Please test and reply on the list if you are still having this issue,

Thanks,

Kelvin

Original comment by kelvin.l...@gmail.com on 17 Aug 2010 at 4:23