Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiden element wrong positions #168

Open
fgvicente opened this issue Aug 16, 2016 · 1 comment
Open

hiden element wrong positions #168

fgvicente opened this issue Aug 16, 2016 · 1 comment

Comments

@fgvicente
Copy link

If one element is hide, take next. Now is show but in whrong position

@EragonJ
Copy link
Owner

EragonJ commented Aug 17, 2016

@fgvicente if the element is hidden, by default you can't get it's position from javascript (Please check this demo : http://jsbin.com/qavemotovu/edit?html,css,js,console)

You can show the element first, then ask Trip.js to position at the right place. You can easily use onTripChange to do that.

phroggar added a commit to phroggar/Trip.js that referenced this issue Jan 3, 2019
By changing $root from body to html the scrolling is fixed ( see https://stackoverflow.com/questions/46071588/chrome-61-jquery-scrolling-not-working-anymore ). Affects EragonJ#190  and EragonJ#195 

If the sel option is used an leads to a hidden element, the positioning will not work. As a quickfix you can make sure that only visible elements are selected by adding :visible to the CSS selector. Affects EragonJ#168 

Please note that these changes have not been tested on various browsers and the ':visible' change is a bit dirty. But the changes worked for me so far and i wanted them documented for everyone else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants