JamyGolden / PlusSlider

A very agnostic jQuery content slider/fader
http://css-plus.com/examples/plugins/PlusSlider/
MIT License
30 stars 12 forks source link

Additional functions (toSlide function and callback function) #2

Closed jordanlev closed 13 years ago

jordanlev commented 13 years ago

Hi Jamy, Added a toSlide() function so you can move to any slide # in code, and added a callback you can pass in to be notified of when a slide changes. Did some refactoring along the way to reduce code duplication. If you'd prefer to just have the toSlide() function but not over-complicate the thing with the callback, that's totally understandable -- I can put together a different branch with just that on it.

Still haven't gotten to fixing up my prior pull request -- just been too busy with work (these new additions are a direct product of a work project, so that's why I got to them first).

Thanks!

-Jordan

JamyGolden commented 13 years ago

Very cool Jordan. The callback is an awesome addition. I've got a few changes I'm going to add this week sometime, including the option to change previous and next text, having youtube videos pause when not the current slide and play if it was not paused before it was navigated away from - If that makes sense. I'm also considering adding a caption option. Eventually I want to work on a carousel effect instead of sliding from :last-child back to :first-child.

This pull request can't be automatically merged for some reason, I'll add this in this week and attribute the changes to you.

Thanks for showing interest and helping to make PlusSlider a better overall content-slider for everyone.

JamyGolden commented 13 years ago

HI Jordan,

I wasn't able to automatically merge this. I followed git's manual instructions and it still gave me some errors. I committed it and then pushed and it seemed to work fine. I've give it the description "merged a jordanlev:additional-functions conflict".

P.S. I wasn't able to save the readme update you did. also, I saw you mentioned something about 'slider = new $.plusSlider($('#slider'), {});' in the readme. I wasn't able to get the callback function to work like that, however onSlide: function(){}; works perfectly. Would you mind updating the current readme?

Thanks :)

jordanlev commented 13 years ago

Hi Jamy, I'm about to go on a brief vacation, but wanted to respond before I leave. When I get back next week I will take a closer look at this. In the meantime, I could use a bit of clarification on your comment: so it sounds like you got all of the code merged in but just want me to add back some stuff to the readme file -- is that correct? And what do you mean exactly by onSlide:function(){} -- just that this portion of the code is in there and working? Or is that an alternate method to tap into the callback? Weird that you couldn't get it to work the way I had -- I've had it functioning on a live site for some time now without any problems.

Thanks for clearing up whatever you can for me.

JamyGolden commented 13 years ago

Hi Jordan,

It was late when I was updating everything, and it seems like 'slider = new $.plusSlider($('#slider'), {});' works perfectly! I wasn't sure about the readme because I couldn't get this to work. I'll merge your readme changes sometime this week.

Thanks!

jordanlev commented 13 years ago

Okay, I'll hold off on doing anything for now -- just let me know if you'd like assistance with anything though (I'll be back and generally available to work on stuff starting next week).

JamyGolden commented 13 years ago

Cool I've just done an update. I've completely replaced nextSlide() with toSlide() and minimized the .js file quite a bit because of that. I'm going to close this pull request.