josecebe / twbs-pagination

jQuery pagination plugin (bootstrap powered)
http://josecebe.github.io/twbs-pagination/
Other
1.1k stars 402 forks source link

How to use twbsPagination in cascading lists #47

Closed chikkanti closed 9 years ago

chikkanti commented 9 years ago

Hi team,

I am using your pagination plugin, It's simply superb and it is working good. I want to use twbsPagination plung in for cascading listas or nested lists or sliding lists.

for example: along with http://alizahid.github.io/jquery-sliding-menu/ Could you please help me.

pavelthq commented 9 years ago

Currenlty jquery-sliding-menu doesnt provide API to swith by pages. So you should manually create this api, by taking jquery-sliding-menu switching function.

var target = $(href),
    isBack = $(this).hasClass('back'),
    marginLeft = parseInt(wrapper.css('margin-left'));

if (isBack)
{
    if (href == '#menu-panel-back')
    {
        target = currentPanel.prev();
    }

    wrapper.stop(true, true).animate(
    {
        marginLeft: marginLeft + menuWidth

    }, 'fast');
}
else
{
    target.insertAfter(currentPanel);

    if (settings.backLabel === true)
    {
        $('.back', target).text(label);
    }
    else
    {
        $('.back', target).text(settings.backLabel);
    }

    wrapper.stop(true, true).animate(
    {
        marginLeft: marginLeft - menuWidth

    }, 'fast');
}

currentPanel = target;

menu.stop(true, true).animate(
{
    height: target.height()

}, 'fast');

e.preventDefault();

A lot of modification here.