Title: Issue with Offset parametr
Last modified: May 27, 2024

---

# Issue with Offset parametr

 *  Resolved [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * (@webdocopy)
 * [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/)
 * Hi Malihu,
   Could you please help me to debug issue with Offset parameter. I have
   page with anchor on the top of the page (Najít, co potřebujete). When I set #
   header-sticky as offset it didn’t work properly. The offset doesn’t correspond
   to the height of the sticky header. I use positioning for sliding effect (top:-
   90px for hiding and margin-top: 90px to show up the sticky header). I tested 
   this issue with top: 0 and no margin and it works. I guess it has something to
   do with positioning.Thank you for your help.BRTomas
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fissue-with-offset-parametr%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/#post-17784648)
 * Hello Tomas,
 * Indeed, the sticky header position causes the issue. The CSS rules `top` and `
   margin-top` that are used in order to show/hide the sticky header change the 
   actual flow of the elements in the document. This causes the scrolling position
   to change depending on the visibility of the sticky header (e.g. when sticky 
   header is visible, the offset works correctly when clicking the link).
 * The easiest way to solve this is to change the sticky header visibility from 
   CSS `top` and `margin-top` to the `transform` CSS property, as this property 
   does not affect the document flow or element position.
 * So, just add this to you CSS:
 *     ```wp-block-code
       header#header-sticky{
       	top: 0;
       	transform: translateY(-90px);
       }
   
       header#header-sticky.visible{
       	margin-top: 0;
       	transform: translateY(0);
       }
       ```
   
 * Let me know 🙂
 *  Thread Starter [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * (@webdocopy)
 * [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/#post-17789487)
 * Hi Malihu,
 * thank you for your prompt reply. Yes, it works.
 * For the next time in case I am using your plugin I should use only translateY
   for css sliding effect?
 * BR
 * Tomas
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/#post-17790395)
 * You’re welcome 🙂
 * It’s usually better to use `translateY` for such functionality because it performs
   better than `position`, `margin` etc. and it doesn’t affect elements position
   and page layout.
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/#post-17791894)
 * Marking this as resolved but let me know if you need more help.
 *  Thread Starter [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * (@webdocopy)
 * [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/#post-17793248)
 * ok. Thank you for your help.
 * Tomas

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

The topic ‘Issue with Offset parametr’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [WebDocopy](https://wordpress.org/support/users/webdocopy/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/issue-with-offset-parametr/#post-17793248)
 * Status: resolved