Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #863540

    Advasa
    Participant

    Hello

    I have created a slider with links that target IDs on the same page. I all works however I would like it to ‘smooth scroll’ to the Id (right now it just jumps to it).

    I have tried:

    jQuery(document).ready(function($) {

    var $body = $(‘body’);
    var $bodyHeight = $body.outerHeight();
    var $adminbarHeight = $(‘#wpadminbar’).outerHeight();
    var $navbarHeight = $(‘.x-navbar’).outerHeight();

    $(‘.page-id-52 .rev_slider a[href^=”#”]’).click(function(e) {
    e.preventDefault();
    var $contentBand = $(this).attr(‘href’);
    $(‘html, body’).animate({
    scrollTop: $($contentBand).offset().top – $adminbarHeight – $navbarHeight + 1
    }, 850, ‘easeInOutExpo’);
    });
    });

    but not luck.

    Any Idea how i can get this to work?

    Thanks

    Justin

    #864187

    Rue Nel
    Moderator

    Hello Justin,

    Thanks for writing in! Please do edit you slider and remove the action of your button. And you need to change the code of you button. So that the JS script will work out, you must have your button code like this:

    
    <a href="#website" class="x-btn">Click Here <i class="fa-icon-chevron-right"></i></a>

    Please let us know how it goes.

    #864288

    Advasa
    Participant

    Thank you very much, it now works with the button.

    I would like for images to be able to link to the ID as well, is there a way to do this?

    I have tried putting #website in an ‘action’ simple link but that doesn’t work.

    Thanks in advance.

    Justin

    #864594

    Christopher
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #889325

    Advasa
    Participant
    This reply has been marked as private.
    #889332

    Advasa
    Participant

    I just figured out how to make it work for images, all i needed to do was change the link type to “a Tag Link” under the layers “actions”.

    Thanks

    #889861

    Christian
    Moderator

    Glad you’ve figured it out. 🙂