Skip to content

Instantly share code, notes, and snippets.

@dimsemenov
Created May 1, 2020 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimsemenov/b67a55ad09fc2a49e592ea67473c2da2 to your computer and use it in GitHub Desktop.
Save dimsemenov/b67a55ad09fc2a49e592ea67473c2da2 to your computer and use it in GitHub Desktop.
(function($) {
/**
*
* RoyalSlider global caption module
* @version 1.0:
*
*/
$.extend($.rsProto, {
_initGlobalCaption: function() {
var self = this;
if(self.st.globalCaption) {
self.ev.on('rsAfterInit', function() {
self.globalCaption = $('<div class="rsGCaption"></div>').appendTo(self.slider);
setCurrCaptionHTML();
});
self.ev.on('rsBeforeAnimStart' , function() {
setCurrCaptionHTML();
});
function setCurrCaptionHTML() {
self.globalCaption.html(self.currSlide.caption);
}
}
}
});
$.rsModules.globalCaption = $.rsProto._initGlobalCaption;
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment