Closed zzseba78 closed 4 years ago
Have you tried this option: https://flickity.metafizzy.co/options.html#cellalign
Thanks for your response! yes, but this is for center the slider items, i need to center the item when clicked ( active ), just like asNavFor navigation does.
It should center as you desire, make sure the slides are not 100% width, but a natural width based on their content
Center the slider is not what i need, i need to center the active item when is selected. You click on any slider item, it highlight ( i do it with css ) and the item moves to center.
https://flickity.metafizzy.co/options.html#asnavfor Just like this one:
Do you have a live example? I believe "cellAlign" will add this functionality. The active slide should be centered in the gallery.
@clarknelson Hi! No it doesn´t, it just center items. https://flickity.metafizzy.co/options.html#cellalign
Isn't this what you are looking for?
@clarknelson No, i need to center the clicked slider item, just like asnav does.
Are you using isNavFor? Did you see that it requires an extra package if you are not using the bundled version. Can see more configuration options in this repo: https://github.com/metafizzy/flickity-as-nav-for
Hi @clarknelson ! I want the same behavior as isNavFor ( i mean, each time you click the item, item is centered in slider ), but is not a sub nav, is just one slider that loads ajax content. Is this possible?
@zzseba78 Do you mean centering an item that is to the side when it is clicked? This should do it:
flkty.on( 'staticClick', function( event, pointer, cellElement, cellIndex ) {
if ( !cellElement ) {
return;
}
flkty.selectCell(cellElement, false, false);
});
Is there a way to center selected slide, just like asNavFor does, but in a single slider? Because the slider act as navigation that loads with ajax some content. Thanks!