Plugin Author
malihu
(@malihu)
Hello and thanks for your comments!
There’s no way to change at which position (relative to viewport) the links get the highlight classes (at least for now).
Maybe you can do what you want by using the .mPS2id-highlight-first or .mPS2id-highlight-last classes instead of the general .mPS2id-highlight in your CSS(?)
Alright I’ll try that, thanks for the help!
Hello Malihu, I fixed my problem partially by taking the div with the ID and taking it further down the page using position:relative and -100vh, now the menu is behaving like I want to.
I thought I could set the scroll position back using the offset option, however I can only but pixels in here.
Is there any way I could input a scoll offset of vh or %?
Thanks for the help!
Plugin Author
malihu
(@malihu)
Offset option accepts either a fixed pixel value or an element selector (to calculate its height). If you have an element in your HTML that has the same height as the viewport height (e.g. some div, the body etc.) you can set it as the offset value.
If you don’t have such element, you’d have to add an extra js script in your theme/template to change plugin’s offset dynamically. Check if your theme provides a way to enter some custom javascript or place the following in your footer.php right before the closing body tag:
<script>
(function($){
$(window).on("load resize",function(){
$(document).data("mPS2id").offset=Math.max(document.documentElement.clientHeight,window.innerHeight || 0);
});
})(jQuery);
</script>
-
This reply was modified 9 years, 8 months ago by
malihu.
Thanks for all the help, everything is working exactly like I want now.
I dont have much cash to spare but I made a small donation for your troubles via your website.
Plugin Author
malihu
(@malihu)
Awesome, glad it worked as you wanted!
Thanks a lot for the donation. I really appreciate it and any amount is more than enough š
Hello again Malihu,
I was hoping you could help me out 1 last time;
I’m almost done with the site, but sometimes when you click a menuitem it seems it when you arrive there it’s 1 pixel off it’s destination so the menu item doesn’t light up.
Here’s the website I’m working on:
http://www.pietereliens.com/
Plugin Author
malihu
(@malihu)
You could try adjusting the offset like:
$(document).data("mPS2id").offset=Math.max(document.documentElement.clientHeight,window.innerHeight || 0)-2;
and subtract (or add) the pixels amount you want at the end.
-
This reply was modified 9 years, 7 months ago by
malihu.
-
This reply was modified 9 years, 7 months ago by
malihu.