7

I am using jssor image slider to show images, but i am facing problem in reloading the slider.

I am fetching the image URL at runtime from the server via WebService.

I need to display newly fetched image URLs.

But I could not find any API to refresh the slider, nor clear the slider and update.

Please let me know, if anyone have done this.

Thanks Harisha

harisha
  • 119
  • 2
  • 7

1 Answers1

0

You can place any content in each slide and you can remove/insert elements freely at runtime.

    <div u="slides" ...>
        <div id="slide1"><!-- any content of slide1 /></div>
        <div id="slide2"><!-- any content of slide2 /></div>
    </div>

In this manner, you'd handle image size by yourself and never use u="image" attribute for any image.

jssor
  • 6,995
  • 2
  • 18
  • 21
  • 1
    This does not seem to work for me. I have assigned an id to the outer div, and am using jQuery to append() new pics to it. Does not work. – slowpoison Jun 13 '14 at 00:08
  • 1
    don't operate on outer div, you cannot add/remove slides dynamically. but you can manipulate each slide, and alter everything in any slide. – jssor Jun 13 '14 at 06:54
  • @jssor I created a function changing outer div, but it is not working. I understood. How did we can change u="slides" content by javascript? – Andre Mesquita Nov 09 '17 at 13:57
  • 1
    sorry that for now there is no option to do this job, you'd create a new slider. we are going to add `$ReloadSlides(slides_html)` and `$AppendSlides(slides_html)` api. – jssor Nov 16 '17 at 08:54
  • Thanks, @jssor. I solved by named element for images and change by javascript. I'm using jssor with lightgalery.js. I expected to have a slide object I could manipulate. But there was a quick and clean solution. Thanks for the answer. – Andre Mesquita Nov 16 '17 at 18:52