xbsoftware / enjoyhint

MIT License
777 stars 275 forks source link

scrollTop issue in stepAction #18

Open gmrx38 opened 9 years ago

gmrx38 commented 9 years ago

Hello, i've an issue when in the webpage there is a fixed (position fixed in CSS) menu/toolbar (with z-index). The highlighting is behind my menu...

Any tricks ? Or maybe, add a offset adjustement parameter in the step settings like scrollAnimationSpeed to adjuste manually if necessary

Thanks you realy much.

gmrx38 commented 9 years ago

I've tried this in my app

enjoyhint.js:84
$(document.body).scrollTo(step_data.selector, step_data.scrollAnimationSpeed || 250, {offset: -100 + (step_data.scrollOffset ? step_data.scrollOffset : 0)});
setting :
[
    {
            selector: '.myClass',
            event: 'click',
            description: ""
            scrollOffset: -60
        }
]

... and it works pretty well ! But, I don't know how make it "automatic" in my kind of situation (I think it's not possible)