5

I've got a page using Cycle2 to run a slideshow with a hide show element to it.

It's all working great, except when I expand the slide and close it again, the height goes off. If I slightly resize the window, this will trigger the recalculation and then the space from the height gets put back right.

I'm using

data-cycle-auto-height="container"

I basically just need to trigger this action that happens on a resize.

Any tips?

Steve de Niese
  • 964
  • 2
  • 10
  • 18
  • How are you expanding/collapsing the slide? i.e. are you using jQuery slideUp, etc? Cycle2 adds the height property to the slide using the auto-height option, and therefore when hiding/collapsing it's likely you're losing the original height property set by Cycle. – Cue Sep 16 '14 at 15:51

1 Answers1

1

The cheat way to do it would be to assign a listener to your plugin's open/close events that triggers a window resize.

$(window).on('your_event_name', function() {
  $(this).resize();
});

If you've got the time though, you should dig in a little deeper and figure out what's actually happening. Ideally, your plugin would handle this stuff on it's own.