Help with syntax

silviu.guseila's Avatar


25 Jul, 2016 06:27 PM


I have to maintain old code/website and found this syntax, can you please explain why .data() is used here?

    var si = $('#rsBanner').royalSlider({
        addActiveClass: true,
        arrowsNav: true,
        loop: true,
        keyboardNavEnabled: true,
        imageAlignCenter: true,
        slidesSpacing: 0,
        numImagesToPreload: 3,
        imageScaleMode: "none",
        autoScaleSlider: false,
        autoHeight: false, // s
        autoScaleSliderWidth: iW,
        autoScaleSliderHeight: iH,
        imageScalePadding: 0,
// imgWidth: mW,
// imgHeight: mH,
        allowCSS3: true,
        visibleNearby: {
            enabled: true,
            center: true,
            centerArea: cA
        autoPlay: {
            enabled: true,
            pauseOnHover: true

What is the recommended way of initialing the slider?

Thank you!

  1. Support Staff 1 Posted by Dmitry Semenov on 25 Jul, 2016 07:55 PM

    Dmitry Semenov's Avatar


    If your si variable isn't used anywhere - data('royalSlider') is not required.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? 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