-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Problem with div inside/below scrollable div #350
Comments
I have the same issue. $(container).animate({scrollTop: $elm.offset().top}, "slow"); It would be great if the scroll container could be added as a config option ({scrollContainer: '.asdf'}) |
can u plz provide jffidle with your solution to test? thanx |
Hi, does anyone know how to solve this problem? Scrolling doesn't help as the problem lies in incorrect positioning of element. Problem is with the algorithm used in this function: function _getOffset(element) {
var elementPosition = {};
var body = document.body;
var docEl = document.documentElement;
var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;
if (element instanceof SVGElement) {
var x = element.getBoundingClientRect()
elementPosition.top = x.top + scrollTop;
elementPosition.width = x.width;
elementPosition.height = x.height;
elementPosition.left = x.left + scrollLeft;
} else {
//set width
elementPosition.width = element.offsetWidth;
//set height
elementPosition.height = element.offsetHeight;
//calculate element top and left
var _x = 0;
var _y = 0;
while (element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {
_x += element.offsetLeft;
_y += element.offsetTop;
element = element.offsetParent;
}
//set top
elementPosition.top = _y;
//set left
elementPosition.left = _x;
}
return elementPosition;
} I have created a fiddle, which logs position using algorithm from http://stackoverflow.com/a/442474/37596 and using element.getBoundingClientRect() Fiddle: http://jsfiddle.net/s9ypgo6c/8/ |
has anyone solved this issue? |
Scroll parent element to targetElement; resolves usablica#210; resolves usablica#350;
Scroll parent element to targetElement; resolves usablica#210; resolves usablica#350;
This or something very similar is happening to me with version 2.9.3 I have to manually change |
The same problem occurred when using version 2.9.3, and the situation was the same as in the jsfiddle example. Browser version: Microsoft Edge 84.0.522.52 |
Experiencing an issue with Intro.js version ^7.2.0. Has this been resolved, or is there an alternative solution? Could someone provide information on this matter? If fixed, do I need to modify my code for proper functionality? Are the latest changes/fixes deployed? I have attached a video file for the issue which I am getting. Video Link: https://github.com/usablica/intro.js/assets/84620359/e512faba-d5ae-45de-82f7-13c82785b629 Code:
|
This issue persists in Intro.js v8.1.0-beta.1, which is even more problematic than the CDN @ 7.2.0. When I target a UI element in a scrollable sidebar, JS Intro scrolls down so that the element as at the top scroll position, and then back up unnecessarily—even though the element is already visible and doesn’t require scrolling. It also highlights the section of the sidebar where the element was located (at the top). 7.2.0 corrects itself by the next element, but 8.1.0 continues for each sidebar element. UpdateFixed it by adding this CSS to my sidebar |
When IntroJs is used on an element inside a scrollable div, it looks like the position is calculated wrongly. See fiddle here:
http://jsfiddle.net/s9ypgo6c/1/
The text was updated successfully, but these errors were encountered: