Hide single bullet

dries's Avatar

dries

24 Jun, 2013 01:53 PM

Hello,

Is there an easy way to hide a bullet, if there is only one slide ?

Thank you.

  1. Support Staff 1 Posted by Dmitry Semenov on 24 Jun, 2013 07:10 PM

    Dmitry Semenov's Avatar

    Hello,

    I suggest to simply not to initialize the slider if there is one slide.

    Or you can do something like:

    if ($('.royalSlider').data('royalSlider').numSlides === 1) { 
      $('.rsNav').hide(); 
    }
    

    (after slider initialization)

    Dmitry

  2. 2 Posted by dries on 25 Jun, 2013 07:52 AM

    dries's Avatar

    Ok, thank you !

  3. 3 Posted by Alex Belletti on 20 Sep, 2013 09:19 AM

    Alex Belletti's Avatar

    var slider = $('.royalSlider'),
    nav = slider.find('.rsNav');
    if (slider.data('royalSlider').numSlides <= 1) {
    nav.hide();
    }

  4. 4 Posted by dries on 02 Oct, 2013 02:41 PM

    dries's Avatar

    Thank you Alex.

  5. 5 Posted by dsaenz on 19 May, 2014 11:35 PM

    dsaenz's Avatar

    how would you hide the bullets but yet still keep the arrows?

  6. Support Staff 6 Posted by Dmitry Semenov on 20 May, 2014 11:10 AM

    Dmitry Semenov's Avatar

    @dsaenz, controlNavigation:'none'? .rsNav {display:none }?

  7. 7 Posted by dsaenz on 20 May, 2014 03:30 PM

    dsaenz's Avatar

    Thanks for your quick response! you the best!

  8. 8 Posted by ad on 21 Jul, 2015 08:08 PM

    ad's Avatar

    Hi I have this code working, but if I have more then one RoyalSlider in the page even if have more then 1 slide, they also has bullets hidden.....is there a way this code can just hide for the sliders with 1 image? even if I have others slider in the same page? All Slider has the same class, formating.

            jQuery(".royalslider-home").royalSlider({
                // options go here
                // as an example, enable keyboard arrows nav
                keyboardNavEnabled: true,
    controlNavigation: 'bullets',
    globalCaption:true,
    arrowsNavAutoHide: true,
    imageScalePadding: 0,
    autoScaleSlider: true,
    autoScaleSliderHeight: 805,
    navigateByClick: false,
    autoPlay: {
    // autoplay options go gere
    enabled: true,
    delay: 4000
    }
            });

    var slider = $('.royalSlider-home'),
    nav = slider.find('.rsNav');
    if (slider.data('royalSlider').numSlides <= 1) {
    nav.hide();
    }

    Thanks!

  9. Support Staff 9 Posted by Dmitry Semenov on 22 Jul, 2015 10:32 AM

    Dmitry Semenov's Avatar

    ^ add some specific class to slider that shouldn't have bullets, and just hide them via CSS, e.g.:

    .royalSlider-home .rsNav {
      display: none;
    }
    
  10. 10 Posted by ludwig.arcache on 18 Nov, 2017 11:31 AM

    ludwig.arcache's Avatar

    I don't want to hide the bullets, I want to hide the horizontal slider when only 1 image exist.

    should I add this ?

    <script>
    if ($('.royalSlider').data('royalSlider').numSlides === 1) {
      $('.rsNav').hide();
    }
    </script>

  11. 11 Posted by ludwig.arcache on 18 Nov, 2017 11:51 AM

    ludwig.arcache's Avatar

    fixed. thanks

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