Carousels, little help!

30 views
Skip to first unread message

Natan

unread,
Apr 18, 2012, 5:06:15 AM4/18/12
to chic...@googlegroups.com
I'm trying (or I fail trying) modifying the carousel. To illustrate, you can se in the attached file, the firs image represent the actual carousel design, and the image below represent what I want to accomplish.
I've found out some hardcode CSS on the Carousel component, I didn't want to modify it without discussing it first. This is the thing it's bothering me: https://github.com/mercadolibre/chico/blob/master/src/js/carousel.js#L375 a margin that mess up all the calculations. I've tried to use the 'onready' event make some changes to the carousel structure, and trigger a .redraw(), but it's mess up all the calculations.
Any other ideas?

I could help refactoring some of the code, let me know what are your thoughts.

Cheers
carouseldrawings.png

Natan

unread,
Apr 18, 2012, 7:12:12 AM4/18/12
to chic...@googlegroups.com
Find a better illustration of my idea with some references of UI elements attached

Natan

unread,
Apr 19, 2012, 5:30:36 AM4/19/12
to chic...@googlegroups.com
What are these lines for?
https://github.com/mercadolibre/chico/blob/master/src/js/carousel.js#L276

// Calculate variable margin between each item
that.itemsMargin = Math.ceil(((maskWidth - (that.itemsWidth * that.itemsPerPage)) / that.itemsPerPage) / 2);

// Modify sizes only if new items margin are positive numbers
if (that.itemsMargin < 0) { return; }

I mean, why are the carousel avoiding rendering when the margins are negative? I might want that... Because a design adjustment (it's just the case);


On Wednesday, April 18, 2012 11:06:15 AM UTC+2, Natan wrote:

Hernán Mammana

unread,
Apr 19, 2012, 9:46:56 AM4/19/12
to chic...@googlegroups.com
Hey! Natan, 

we think we will working with this component in some days, thanks for your feedback and your cool ideas!

But if you want you can change it and make a pull request!

;)

Hernán M.

Natan

unread,
Apr 19, 2012, 10:10:09 AM4/19/12
to chic...@googlegroups.com
I've started working on a responsive carousel. I'll show you later. Although the awful bug, the gremlin buttons is Fixed. You can merge it. 

Hernán Mammana

unread,
Apr 19, 2012, 10:27:01 AM4/19/12
to chic...@googlegroups.com
Great! Gremlin buttons is merged.
Reply all
Reply to author
Forward
0 new messages