jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
1.99k stars 736 forks source link

a specific query regarding refreshing the carousel list without scrolling #648

Closed diyafury closed 10 years ago

diyafury commented 10 years ago

Hi

I have horizontally expanding list items in my carousel...I manually alter the position of the list containter (ul) when I expand an item to center the expanded item within the carousel. I then need the list width to update after the the expansion of an item to take into account the widened list (ul) in order for the next/previous controls to update accordingly. I have noticed that when I click on a next/prevous control, the list width updates before it starts to scroll - so in effect I want to be able to call that update action. Is this possible, is there a private method I can call? I tried 'reloading' the list but nothing seems to happen and I get no errors. I would very much appreciate your help. Great plugin, have been my favourite for years.

Cheers

jsor commented 10 years ago

Could you setup an example where i can see this?

diyafury commented 10 years ago

Hi there - it's not public at the moment and a bit of a beast to recreate an example of. I'll try and explain better as the situation has changed somewhat...I have a horizontal carousel with li elements that when clicked upon expands (horizontally to the right) and reloads the carousel (got this working), the next/previous controls update as expected taking into account the new width of the ul which is great. However, as well as expanding the item, I manually center the item by moving the jcarousel ul's left offset. This ofcourse means that the controls are not aware of the offset change. I realise that jcarousel does not currently support a pixel offset parameter but was wondering whether you can think of an easy way to extend a method or something to get the next/previous controls to take the pixel offset into account? Your help is much appreciated as the carousel works perfectly otherwise (uses nested carousels for each element also) and I would loathe to change it at this stage.

jsor commented 10 years ago

Changing the position from the outside confuses jCarousel. There is a center option, but it is experimental and may not work as expected, especially with wrap: cirular.