Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #959870

    Hi

    I am looking to reveal a color section, when clicking on a button or link and I can do this with code taken from https://kriesi.at/support/topic/hidding-color-section/#post-432734.

    However, Im looking for same effect as an anchor link were the section scrolls to the top of the page, in addition to being revealed?

    Can this be done?

    Kind regards

    Duncan

    #960826

    Hey dweddell,

    Try using this code:

    
    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery("#your-unique-color-section-id").hide();
    jQuery( ".your-custom-button-class" ).click(function() {
      jQuery( "#your-unique-color-section-id" ).toggle();
      window.scrollTo(0,0);
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #960866

    Thanks Victoria

    I tried this, but section still wont scroll to the top?

    cheers

    Duncan

    #962222

    Hi,

    Do you want it to scroll to the section when it is revealed? That is what happens when I clicked on the “answer” button.

    Best regards,
    Ismael

    #963821

    Hi Ismael

    I am looking for the section to scroll to the top of the page, in a similar manner to the link below.

    Strangely, it works when I press the button on the third attempt, but not on the first

    kind ergards

    Duncan

    #965075

    Hi Duncan,

    I’m not sure if I’m missing something here, but the Click here link on the page you posted opens the section, then scrolls down to the divider on my end. Is that the correct behaviour?

    Best regards,
    Rikard

    #969674

    Hi Rikard

    I’ve made a screencast so you can view what I’m seeing.

    The first site (which im working on using Enfold) is not scrolling to the top. Whereas an existing site, which I’m basing the new site on scrolls nicely to the top.

    Can I do this with the site Im working on?

    Kind regards

    Duncan

    #970725

    Hi Duncan,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Is the custom code still there?

    Best regards,
    Victoria

    #971058
    This reply has been marked as private.
    #971221

    Hi Duncan,

    You will need to have a bit more complex JavaScript function here.

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.