Creating slider from array

smares's Avatar

smares

19 Aug, 2012 09:20 PM

I was wondering if it's possible to create an image slider for example using an array of image URLs or something that is not part of the DOM.

  1. Support Staff 1 Posted by Dmitry Semenov on 20 Aug, 2012 09:40 AM

    Dmitry Semenov's Avatar

    I just updated slider and added slides option. It accepts string with HTML code of slides. You can get it from slider online build tool page. There is no way to pass directly URL, as parsing algorithm is module-dependent.

    So here is how to use it:
    1. Add root slider node to DOM.

    <div class="royalSlider rsDefault"></div>
    
    1. Initialize slider with slides option:
    $('.royalSlider').royalSlider({
          slides: '<a class="rsImg" href="/img/image1.jpg">1<span class="rsTmb">thumbnail text 1</span></a><a class="rsImg"    href="/img/image2.jpg">2<span class="rsTmb">thumbnail text 2</span></a>'
    });
    

    Hope that helps.

    Dmitry

  2. Dmitry Semenov closed this discussion on 20 Aug, 2012 01:44 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac