Skip to content
This repository

Added a "slideTo(idx)" interface function #176

Closed
wants to merge 3 commits into from

4 participants

Markus Schirp fairsayan alexnix matiazar
Markus Schirp
mbj commented

Hello gilbitron,

I added a slideTo function, developers can use it to execute a "Slide to this index, NOW!" Operation.

In case a transition is in process the operation will queue the transition until the current transition stopped.
In case a transition is in process and more then one slideTo calls it will only queue the last call after transition stopped.

I need this functionality for one of my projects where an interactive sidebar was involved. The project is not public now but it will be, I'll send you the url when it goes online.

I got a very different feeling about indentation and code formatting than you, so you'll not simply pull my commits. Maybe you should just copy the affected lines.

Feel free to pull or comment,

Regards,

Markus

Markus Schirp

In line 641 starts the relevant slideTo functionallity

Markus Schirp
mbj commented on 15a48a4

Here it ends!

great... but for what version of nivo slider is this code working ?!

This is an ultra old pull request, it will be much more easier to recode this mess. Will close this request.

As I see the pull request was already closed by myself. @matiaza This patch works against the nivo-slider git tree as it was 11month ago :D

Hi,
I can`t make it work. I am using last version og nivoslider (available on ther website)

mbj replied

@alexnix This code is sooo old, it is very very very unlikely you'll be able to use it.

Never mind. I found a solution to replace slideTo() function, I am posting it here so all fellow developers who might need it to see.
Added a jQuery handeler to to click() event. on the nav buttons, that trigger a click on the nivo-control class. The nav buttons have the class 0,1.. etc as the slide it reffers to.
$('nav li').click( function(){
var slide = $(this).attr('class');
$('.nivo-control[rel='+slide+']').click();
} );
Remember to specify the rel attribute of the nav-control. :D

Markus Schirp
mbj commented

I just marked the relevant lines in the last commit of my pull request!

fairsayan

Great fork. I hope it will be pulled

Markus Schirp
mbj commented

obsolete, closing.

Markus Schirp mbj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.