Title: Offset from bottom
Last modified: January 24, 2017

---

# Offset from bottom

 *  Resolved [tv3master](https://wordpress.org/support/users/tv3master/)
 * (@tv3master)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/)
 * Hi, i am using the plugin to scroll to an image slider, where i want the bottom
   off the slider to align with the bottom off the browser.
    Is there any way i 
   can set the ofsset from the bottom?

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

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8693477)
 * Hi,
 * It is not possible to offset page scrolling from the bottom of the viewport (
   at least not via plugin’s options).
 * The only way to do what you describe is via javascript. Can you add custom js
   code to your theme? If yes, let me know (I’ll provide a code sample which you
   can use with your elements).
 *  Thread Starter [tv3master](https://wordpress.org/support/users/tv3master/)
 * (@tv3master)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8695377)
 * Hi
 * I am new to wordpres so i have no idea whether i can.
    Is it as simple as adding
   it in the text view in the page editor? If no, how can I check I can add custom
   javascript? or even enable it by installing a plugin?
 * And thanks for the fast response!
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8698349)
 * Post/page editor does not accept javascript code.
 * You should first check if your theme provides an option to insert custom js (
   this is usually via some text field under a theme option). If such option exist,
   you should use it.
 * Another way would be via some plugin, e.g.
    [https://wordpress.org/plugins/custom-css-js/](https://wordpress.org/plugins/custom-css-js/)
 * Lastly, you can add the code manually in your theme’s template. The problem with
   this is that the custom code will be removed if/when you update the theme (just
   the theme, updating WordPress won’t remove it). To avoid this, you’ll need to
   [create a child-theme](https://codex.wordpress.org/Child_Themes).
    To add it 
   manually, go to ‘Appearance’: ‘Editor’ and click to edit ‘Footer (footer.php)’
   under templates. Find the line with: `<?php wp_footer(); ?>` and add the custom
   js script below it inside a script tag (`<script>...the js code below goes here...
   </script>`). Click ‘Update File’ to save it.
 * So, the code below is the one to use. Note that you should change the `#section-
   2` value to the id value you used (i.e. your image slider id):
 *     ```
       (function($){
         $(window).on("load resize",function(){
           var val="#section-2"; //set your element's id/hash fragment value
           $("a[href*='"+val+"']").data("ps2id-offset",function(){
             return $(window).height()-$(val).height();
           });
         });
       })(jQuery);
       ```
   
 * Let me know 🙂
    -  This reply was modified 9 years, 4 months ago by [malihu](https://wordpress.org/support/users/malihu/).
 *  Thread Starter [tv3master](https://wordpress.org/support/users/tv3master/)
 * (@tv3master)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8698850)
 * I tried adding the code via my child theme in foother.php, directly in my parent
   theme and with the plugin. all failed and made the page scroll to the bottom 
   when it loaded, or when I scrolled up and clicked the link again.
 * I did forgot to note these things however:
 * for testing purposes I added a target id shortcode, and also to make sure there
   was not a problem with using my slider id.
 * the scroll link is in the form of a # code (#scroll is what I am using) in the
   link linking to the page (so like this: index.php/link_to_page/#scroll)
 * and finally: I have a header that becomes smaller and has a fixed position as
   I scroll down the page.
 * Please don’t waste to much of your time helping me with this one, it is not a
   big problem if I don’t get it to work 😉
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8699100)
 * If your link is like `index.php/link_to_page/#scroll`, then you should change:
   `
   var val="#section-2";` to: `var val="#scroll";` in the script code.
 * Can you post a link of your site/page? I’d probably be able to help solve the
   issue if I could visit your url.
    -  This reply was modified 9 years, 4 months ago by [malihu](https://wordpress.org/support/users/malihu/).
    -  This reply was modified 9 years, 4 months ago by [malihu](https://wordpress.org/support/users/malihu/).
 *  Thread Starter [tv3master](https://wordpress.org/support/users/tv3master/)
 * (@tv3master)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8702021)
 * Yeah I know, i did that 😉
 * Is there a way I can send it in private? Since it is for a school project I don’t
   really like to have a visit from the whole internet on my website. The server
   is also quite slow so it doesn’t really help if other people are checking out
   the site aswell :s
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8703142)
 * Sure, [contact me](http://manos.malihu.gr/contact/) 🙂

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

The topic ‘Offset from bottom’ 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: [9 years, 4 months ago](https://wordpress.org/support/topic/offset-from-bottom-2/#post-8703142)
 * Status: resolved