jsor / jcarousel

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

indicator stay still when I load content dynamically #712

Closed spyalert01 closed 10 years ago

spyalert01 commented 10 years ago

I wrote a PHP script that build the OL LI

and carousel inner dynamically, in my JS I do something like this $("#carousel-adv").load("http://bla.bla.com/bla.php"); //this PHP echo the OL LI, and carousel inner in carousel-adv div.

The problem is the indicator always stay still at the FIRST Position (index 0), But the picture slide properly.

What should I do to make it Indicating the correct position according to SLIDE.

I suspect my coding could be wrong, so I view source and copy the HTML generated by my coding, and put them into the static html page, and the indicator and picture is working properly.

Any suggestion?

spyalert01 commented 10 years ago

Problem solved. Instead of (div).load, I use ajax get with async set to false. This is because while the content is loading from another URL, the script keep proceeding next.