• Hi Malihu,

    I have a question regarding the manual offset built into the plugin when using [ps2id] link tags. I have added the shortcode based on the following syntax:

    [ps2id url='http://enhanceltd.com/challenges/#section-1' offset='-100']link[/ps2id]

    But unfortunately, I cannot get it to offset. When I use the bulk offset from the WP admin panel, this works correctly.

    My working page is here.

    Any help would be much appreciated as always! 🙂

    Edit: I’ve noticed that if I click on the ps2id link text, the offset seems to work, but not with the auto-scroll custom script you gave me recently. Could this be the reason?

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

    (@malihu)

    Yes this is the reason. The offset attribute on the link shortcode is specific to that link only. To set an offset for the scrollTo method you need to do:

    $.mPageScroll2id("scrollTo",to,{
        offset:-100
    });
    Thread Starter Ibby

    (@ibby)

    Brilliant, thank you!

    Is there any way to apply to individual section selectors? I’d like to apply offsets to specific sections (as they are different heights).

    Thank you very much for the support, by the way. My client is very happy with the site and in many ways this is all down to your work!

    As a small suggestion, it would be really good if mousewheel autoscroll was added to the WP plugin by default. Do you have any plans to do so?

    Plugin Author malihu

    (@malihu)

    Thanks for your comments! Glad I helped 🙂

    You could set a different offset for the scrollTo method depending on the target element’s id attribute. For example:

    if(to){
        if(to==="section-1"){
            var offset=-20;
        }else if(to==="section-2"){
            var offset=100;
        }else{
            var offset=-100;
        }
        $.mPageScroll2id("scrollTo",to,{
            offset: offset
        });
    }

    Mouse-wheel functionality depends heavily on theme’s markup and page layout, so it’s not easy to include it in plugin core as a feature. It’s also a bit out of plugin’s scope which is simply about scrolling links to id attributes. Maybe I’ll add it in a future version but I can’t say for sure 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[ps2id] Manual Offset’ is closed to new replies.