Slider resize issue in WP plugin

Pete's Avatar

Pete

05 Jan, 2021 05:37 PM

Hi there. We have a Royalslider that is added to the DOM via JS, and therefore is set to 100px width. Upon resize, the issue is resolved.

I know this is a widely known issue, and I have followed your guidance for the Jquery version with no luck.

Is there a different approach to be taken with the WP version?

Would appreciate your assistance with this,
Thanks

  1. Support Staff 1 Posted by Dmitry Semenov on 06 Jan, 2021 05:40 AM

    Dmitry Semenov's Avatar

    Hello,

    You need to add the slider after it's visible, or call update size method after it happens:

    jQuery('.royalSlider').royalSlider('updateSliderSize', true);
    

    There are no specific instructions for WP version, since the code is the same, these examples may help:

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

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