Update global caption ?

diagne.cyril's Avatar

diagne.cyril

14 Dec, 2012 11:41 AM

Hello,

I'm using RoyalSlider with lot of success in a mobile phonegap project.

However I'm now facing an issue and I wonder if there is anything already built in royalslider to "update" the global caption after an update of the datas of some of the slides ?

My slides are different backbone views whose datas are asynchronously updated after it's been fetched on the server. But I want my slider with global caption to start before everything is finished downloading.
So is there any simple/elegant way to ask royalslider to update the globalcaption ? (hiding the rscaption div and retrieving the data when the slide is highlighted)

Thanks!

  1. Support Staff 1 Posted by Dmytro Semenov on 14 Dec, 2012 11:44 PM

    Dmytro Semenov's Avatar

    Hi,

    To update caption:

    • Update HTML text in rsGCaption element inside slide (if it's current).
    • Update caption value in slides array, for example for third slide:
    jQuery('.royalSlider').data('royalSlider').slides[2].caption = 'new caption html';
    

    Hope that's what you need.

    Dmitry

  2. 2 Posted by diagne.cyril on 15 Dec, 2012 01:43 AM

    diagne.cyril's Avatar

    Hi Dmitry,

    Thanks for your answer. It is indeed what I needed, and got the correct behavior now.
    I was hoping that a royalSlider.updateGCaption() would do exactly that for me, but it doesn't really matter, it's not too much work ^^

    Thanks again!

  3. diagne.cyril closed this discussion on 17 Dec, 2012 06:31 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