If the slider markup is not ready at page load, or you want to update the slider items on the fly, you can use the slider's reload function:
The reload is the slider's built-in function that will help:
View the source of this page for the sample code.