• I enabled the Auto-generate #ps2id-dummy-offset element option because I wanted put differents offsets between desktops and mobiles . My problem is that I need to use negative numbers but don′t go well with the autogenerate dummy element. can you help me please? thanks

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author malihu

    (@malihu)

    You can’t really do negative offsets using element’s selector. It’s usually better to do it with CSS. Can you tell me what exactly you want to do in your page? Where to scroll to when clicking the links?

    Thread Starter fraymores

    (@fraymores)

    Hi Malihu, I am using the theme twenty seventeen in WordPress. The structure of this theme separe the sections by panels and Locate the feature image as a full screen section header.
    I need to scroll until the middle of the image. This make posible to read the section title and a piece of the section. For that reason I need a negative value for the offset.

    Plugin Author malihu

    (@malihu)

    I see. I think it’s better to change your targets to the actual section content instead of the whole section that includes the decorative large image.

    Can you create for example the “Servicios” and “Qué se cuece” targets above or at the sections title and then change your links to those targets?

    Thread Starter fraymores

    (@fraymores)

    Thanks so much for your answers.The problem with this theme is that all the targets are dinamically generated and the structure and targets names are the same for each one of the things inside the panel (titles etc). The only diference is the panel id . For that reason I Teke that target to work with it.

    The other problem I have, is that is not necesary the same offset for mobiles and tablets. Is a little bit complicated.

    Plugin Author malihu

    (@malihu)

    No problem ??

    Would you mind adding some javascript in your theme template?
    It would work properly because the way your theme works, we can’t use its generated ids.

    The theme seem to apply an id on each section title, but the issue is that it applies the exact same id on all titles. This is not correct and cannot be used by CSS or other scripts, as ids must be unique.

    In my opinion, the best way to do what you need is the following:

    1.Add the following script in your theme/child-theme template (e.g. in footer.php just before the closing body tag):

    (function($){
      $(window).on("load",function(){
        $("#panel2 .entry-title").attr("id","servicios");
        $("#panel3 .entry-title").attr("id","que-se-cuece");
      });
    })(jQuery);

    This will give proper ids to the 2 section (“Servicios” and “Qué se cuece”) titles (you can add more if you need).

    2.Change your links URLs from:

    #panel2 and #panel3

    to:

    #servicios and #que-se-cuece

    accordingly.

    3.Add the following to your additional CSS:

    @media only screen and (min-width: 768px) {
      #servicios, #que-se-cuece{
        padding-top: 50vh;
      }
    }

    This will make the page scroll to half the size of the viewport (50vh) before the section title (only on desktop).

    Let me know

    Thread Starter fraymores

    (@fraymores)

    Hi Malihu I have added the script just before closing body, but don′t create any id name .

    Hope you can see what happens, thanks

    Plugin Author malihu

    (@malihu)

    Did you copy/paste the js code? It seems that the code has being pasted with " characters converted to ".
    Can you copy/paste the code exactly as plain text in your editor?
    How did you edit the template? Which editor/setting did you use?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘negative dummy offset’ is closed to new replies.