Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with height before AJAX is finished, solved? #456

Open
cpopolo opened this issue May 10, 2020 · 0 comments
Open

Problem with height before AJAX is finished, solved? #456

cpopolo opened this issue May 10, 2020 · 0 comments

Comments

@cpopolo
Copy link

cpopolo commented May 10, 2020

LightSlider has been great - a real lifesaver... One problem I have had is for text or Highcharts content (i.e. not images) that are delivered to the DIV from AJAX, the LightSlider doesn't know the height of the future content so it assigns zero height. I've tried setting up the OnSliderLoad event with a call to height(), and that worked when I only had one slider. When I added a second instance, only one of the sliders would resize to accommodate the AJAX content. I think maybe the onSliderLoad isn't separate for each instance of the Lightslider...

Nonetheless, after much fussing with this problem, I ended up styling the UL with "min-height" set with a value that is guaranteed to fit the AJAX content.

Is there a better way to have the DIV/UL respond to AJAX content correctly?

One other option could be to call LightSlider in the AJAX success, but this is very awkward since several AJAX calls are involved, plus I'd rather have the space allocated for the slider div as soon as possible to avoid jumping boxes as they get filled.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant