Is it possible to get the new height in advance?

Ian's Avatar

Ian

04 Mar, 2019 06:53 AM

I'm trying to get either one of these in advance (before the animation starts):

  • The height of the new slide.
  • The height of <div class="royalSlider"></div> when the animation is completed.

The <div class="rsContainer"></div> seems to contain only 9 slides at most so I'm being unable to achieve my goal if the new slide is not among the 9 slides.

Please advise. Thanks.

  1. Support Staff 1 Posted by Dmitry Semenov on 04 Mar, 2019 08:04 AM

    Dmitry Semenov's Avatar

    Hello,

    As I understand you're asking about slider with autoHeight:true option?

    This module has rsAutoHeightChange event, you can use it like this:

    var slider = $('.royalSlider').data('royalSlider');
    slider.ev.on('rsAutoHeightChange', function(e, newHeight) {
      console.log('slider height will be changed to', newHeight);
    });
    
  2. 2 Posted by Ian on 04 Mar, 2019 08:12 AM

    Ian's Avatar

    @Dmitry

    Thanks. I tried implementing and testing the example code you provided, but there is no log happening in my console. And I also couldn't find the rsAutoHeightChange event in the documentation and the source code. Could you please advise?

    The version I'm using is v9.4.5. I have had jquery.rs.auto-height v1.0.2 included.

  3. Support Staff 3 Posted by Dmitry Semenov on 04 Mar, 2019 03:33 PM

    Dmitry Semenov's Avatar

    It's an internal event of an autoplay module. Here is a working example: http://jsfiddle.net/DmitrySemenov/28qjLpza/

    If you won't be able to resolve - please link to the page that you're working on.

  4. 4 Posted by Ian on 04 Mar, 2019 03:44 PM

    Ian's Avatar

    @Dmitry

    It turns out that my custom build did not include the Auto height module. I just rebuilt it, and now it works. Thanks a lot!

  5. Ian closed this discussion on 08 Mar, 2019 08:23 AM.

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