Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #463312

    Hi All,

    The more I am working with Enfold, feels like exploring more and more options within this wonderful theme.
    Just wanted to check if it is possible to add an automatic scroll functionality to the home page which scrolls after 5 seconds to the next section. Which in this case is /#av_section_2.

    #463455

    Hi Vikrant!

    Please add following code to Functions.php file of your theme in Appearance > Editor

    function add_custom_link(){
    ?>
    <script>
    jQuery(window).load(function () {
    window.setTimeout(function() {
        window.location.href = 'http://yourdomain.com/#av_section_2';
    }, 5000);
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_link');
    

    Cheers!
    Yigit

    #463471

    Hi Yigit,

    The code does the job but it removes the animation that occurs when you press the scroll arrow on the home page. Let me know if we can do something about it.

    Thanks

    #463900

    Hey!

    Do you mind if we take a look at the website? Please make sure that you have the latest version of the theme.

    Cheers!
    Ismael

    #465021

    #465022

    Please check the given website

    #466242

    Hey!

    it seems to work normally when I press your scroll down arrow on the homepage. About which arrow are you talking about exactly? and what are the steps to see the issue? you can use screenshots (imgur, dropbox) to make things clear.

    Regards,
    Andy

    #504135

    Hi Guys :) i have the same problem as the other guy.
    i have added the code given by Yigit to my functions file.
    all is working fine except of the smooth scrolling animation.

    if i click the next section button the site starts to scroll down super smooth if i just stay on the site to wait until the function does the auto scroll action it does jump to the next section but unfortunately without the great smooth effect.

    is there a way to get that fixed or added to the code Yigit has provided ?

    #504740

    @Shorty05
    Can you show us what’s going on please? provide us a link where we can see the issue.

    Cheers!
    Andy

    • This reply was modified 9 years, 2 months ago by Andy.
    #504795

    Hi Andy,

    if you click the arrow at the bottom of the slider image the website scrolls down to the next section using the smooth scroll effect.

    if you just stay on the site for 5 seconds the code Yigit provided gets in action. The thing is that it just jumps to the section it doesn’t use the smooth scroll effect.

    i hope you understand what i mean.

    #507113

    Hey!

    Try this out.

    function add_custom_link(){
    ?>
    <script>
    jQuery(window).load(function () {
                        jQuery('html, body').animate({
                            scrollTop: jQuery("#av_section_2").offset().top
                        }, 1000);
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_link');
    

    You might want to add a check for the homepage there or just add the script to a codeblock element in the homepage content.

    Best regards,
    Elliott

    • This reply was modified 9 years, 1 month ago by Elliott.
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.