Title: negative dummy offset
Last modified: June 18, 2019

---

# negative dummy offset

 *  [fraymores](https://wordpress.org/support/users/fraymores/)
 * (@fraymores)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/negative-dummy-offset/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fnegative-dummy-offset%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11652198)
 * 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](https://wordpress.org/support/users/fraymores/)
 * (@fraymores)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11654969)
 * 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](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11655446)
 * 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](https://wordpress.org/support/users/fraymores/)
 * (@fraymores)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11655718)
 * 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](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11656438)
 * 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](https://wordpress.org/support/users/fraymores/)
 * (@fraymores)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11664859)
 * 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](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11671446)
 * Did you copy/paste the js code? It seems that the code has being pasted with `"`
   characters converted to `&quot;`.
    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.

 * ![](https://ps.w.org/page-scroll-to-id/assets/icon-256x256.png?rev=1401043)
 * [Page scroll to id](https://wordpress.org/plugins/page-scroll-to-id/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-scroll-to-id/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-scroll-to-id/)
 * [Active Topics](https://wordpress.org/support/plugin/page-scroll-to-id/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-scroll-to-id/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-scroll-to-id/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [malihu](https://wordpress.org/support/users/malihu/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/negative-dummy-offset/#post-11671446)
 * Status: not resolved