• Resolved maitseasi

    (@maitseasi)


    Hi

    Im using the elementor page builder and im trying to scroll to a specific slide via #ID.

    In the header I have four buttons and in the slider I have four slides, i would like to make it so that if I click on the third button in the header, it would scroll down to the smart slider and show me the third slide / second button->second slide etc.

    How, if even, is it possible to do?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Ramona

    (@nextend_ramona)

    Hi @maitseasi

    Yes, you can achieve this but you will need to write custom codes for that. You can find a tutorial here: https://smartslider3.helpscoutdocs.com/article/312-move-to-slides-with-javascript

    Thread Starter maitseasi

    (@maitseasi)

    Thanks for the quick reply, and good to know its possible. If it’s not too much to ask, could you explain the ‘N2R’ part of the code.

    Also, how should I access the Smart Slider Javascript API and should could I also trigger the action with a JS code?

    Ramona

    (@nextend_ramona)

    Hi,

    The N2R is used to access Smart Slider 3’s API.

    Please check the Example at the bottom of the documentation as it shows you how can you use a custom button to trigger the codes.

    Thread Starter maitseasi

    (@maitseasi)

    Thanks Ramona,
    I changed the elementor button ID to ‘#hs4’ and added the following code to my JS file: `N2R(‘#n2-ss-8’, function($, slider){
    jQuery(‘#hs4’).click(function(){
    slider.slide(3);
    });
    });`
    and could not get anywhere.

    I blame my complete incompetence and lack of knowledge for that, so I wont ask any more of your time. Ill ask a buddy of mine to help me out and will reply when I get the answer.. or more questions.

    • This reply was modified 6 years, 6 months ago by maitseasi.
    Ramona

    (@nextend_ramona)

    Hi @maitseasi

    Your code should work if the ID of your Elementor element was set correctly.

    Another reason I can think of that can cause your code to fail is if your slider has only 3 slides, because this code switches to the fourth. (Please refer to the table just below the Go to a slide by its index heading.)
    So if you don’t have a fourth slide nothing will happen when you click on the button.

    Thread Starter maitseasi

    (@maitseasi)

    I do have 4 slides.
    The elementor ID is: <a id="hs4" class="elementor-button elementor-size-xs elementor-animation-shrink" role="button">

    https://shakey.ee/epifond/et/giab/ “Quality” Button, and it should refer to the slider under “main technologies”.

    • This reply was modified 6 years, 6 months ago by maitseasi.
    Ramona

    (@nextend_ramona)

    Hi @maitseasi

    Your problem is that your codes are running way too soon and our codes that define N2R are not there yet. You should either move the scripts to the body part of your site or wrap it inside

    jQuery( document ).ready(function() {
    });

    and that could help as well.

    When you’re working with JavaScript you should use your browser’s Console: https://smartslider3.helpscoutdocs.com/article/318-chrome
    to look for JavaScript errors.

    Thread Starter maitseasi

    (@maitseasi)

    As I already told you in another topic, you are a Godsend! : )
    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Scroll to slide ID’ is closed to new replies.