Wilto / Dynamic-Carousel

A carousel plugin built for responsive layouts. There are many like it, but this one is mine.
matmarquis.com/carousel/
472 stars 112 forks source link

Request: Auto Transition #14

Closed rowanflack closed 13 years ago

rowanflack commented 13 years ago

Absolutely fantastic carousel, one of the few to take responsiveness into the equation.

Feature request: Would love to see an "auto-advance" slide added into this carousel.

rickydazla commented 13 years ago

2nd!

Wilto commented 13 years ago

What do you guys think of using a data- attribute on the carousel wrapper, so this can be more easily applied on a case-by-case basis? I’m envisioning something like <div class="slidewrap" data-autorotate="1000">, where data-autorotate contains the rotation speed.

rowanflack commented 13 years ago

I think that'd be a great idea, nice and simple to control! Looking forward to the release. Really appreciate the support.

rickydazla commented 13 years ago

A data attribute would work really well for me. I will be implementing this on some Shopify sites and will be able to integrate this with their liquid code so that clients can control speed from their settings panel.

Loving your work!

dfischer commented 13 years ago

+1

Please add this. I love the html5 data-attribute idea.

Wilto commented 13 years ago

Somebody start the drumroll.

jamesdoc commented 13 years ago

drumroll

Wilto commented 13 years ago

Done. Have a look at the demo page.

I made a note of this in the readme, but just to reiterate: right now, the auto-advance is dependent on the carousel in question having next/prev links. This thing has reached the point where it really needs to be event-driven (so instead of jumping between functions, a “moveLeft” event is fired on the carousel itself, triggering further actions), so that’s the plan—rather than triggering a click on the next/prev controls, the timeout will trigger a “move” event.

That’s next up on the list, but probably won’t be in place until early next week.

rickydazla commented 13 years ago

WTF is all that noise about?! Who brought drums? Oh... hold on... NIICE1!

dfischer commented 13 years ago

You rock @wilto! Thanks!

dfischer commented 13 years ago

I just want to say that I love that you're taking full advantage of latest HTML5 standards. Thank you.

On Thu, Jul 21, 2011 at 9:19 AM, rickydazla < reply@reply.github.com>wrote:

WTF is all that noise about?! Who brought drums? Oh... hold on... NIICE1!

Reply to this email directly or view it on GitHub: https://github.com/Wilto/Dynamic-Carousel/issues/14#issuecomment-1624662

boberetezeke commented 13 years ago

The auto transition works great....in Chrome. In Chrome it goes back and forth successfully. In Firefox 4 and Safari it just goes to the right and stops. Looking at the code it seems that in the function autoAdvance it gets the current left margin and assumes that it is in percentages. On Firefox and Safari it is in pixels, so the calculation gets it wrong. There are ways to fix this but I don't know of a way to get the value back in percentages if it is given in pixels. It could be manually converted to percentages if the divided by the slide width.

Any help would be appreciated.

Wilto commented 13 years ago

Annnd I’m an idiot. Fix forthcoming.

boberetezeke commented 13 years ago

Wow thanks!

On Jul 22, 2011, at 12:41 PM, Wilto reply@reply.github.com wrote:

Annnd I’m an idiot. Fix forthcoming.

Reply to this email directly or view it on GitHub: https://github.com/Wilto/Dynamic-Carousel/issues/14#issuecomment-1633682

Wilto commented 13 years ago

Fixed.

Completely my bad. I thought this fix had made it into the recent big commit. Applied and retested in the all of the above (including IE 6/7—and if you can make it there, you can make it anywhere).

dfischer commented 13 years ago

Thanks for trying to make it compatible in IE6. I think you can save yourself some headache and ignore it in the future. If Google does, so can you!

On Fri, Jul 22, 2011 at 11:14 AM, Wilto < reply@reply.github.com>wrote:

Fixed.

Completely my bad. I thought this fix had made it into the recent big commit. Applied and retested in the all of the above (including IE 6/7and if you can make it there, you can make it anywhere).

Reply to this email directly or view it on GitHub: https://github.com/Wilto/Dynamic-Carousel/issues/14#issuecomment-1633919

Wilto commented 13 years ago

Hey, this gig wouldn’t be any fun if it were easy, right?

But no worries: there’s no real hackery going on for the sake of clunky old IE—and I’m sure as hell not gonna fix anything to the detriment of any of the grown-up browsers.