anseki / leader-line

Draw a leader line in your web page.
http://anseki.github.io/leader-line/
MIT License
3k stars 421 forks source link

When the box is scrolled, leaderline is not following the box smoothly. Leaderline gets stuck sometimes. #107

Closed Arjun-Tamble-Infrrd closed 4 years ago

Arjun-Tamble-Infrrd commented 4 years ago

Hi @anseki ,

I'm using your library in my project and it has been really helpful to have such a strong and useful library that makes things a lot easier.

However, my concern is that I have a box inside a scroll element. I have one end of the leaderline pointing to this box inside a scroll element. Whenever I scroll, the leaderline is following the box, but, sometimes I observe there is a lag and the leaderline gets stuck in between the scroll. So, how to overcome this issue and have the leaderline smoothly follow the box inside the scroll box when scrolled?

Note: I'm already using Anim-Event library along.

Your help would be highly appreciated.

Thanks, Arjun

anseki commented 4 years ago

Hi @ArjunInfrrd, thank you for the comment. To reproduce that, could you show me an example by using e.g. https://jsfiddle.net/ ?

Arjun-Tamble-Infrrd commented 4 years ago

Hi @anseki , thank you for replying.

Please refer : https://jsfiddle.net/0n28go4u/3/

As you can see here, there are two boxes: box 1 and box 2. Box 1 is inside a scrollable container. And there is a leader line connecting box 1 and box 2. When i move box 1 by scrolling it, leaderline follows box 1, but sometimes the movement of the leaderline is not smooth, it gets stuck and frozen for sometime. So, how to make a leaderline movement smooth when scrolled?

Note: I could not add a leaderline library in my sample code that i'm showing you. Please assume a leaderline connecting box 1 and box2.

Thank you

taurenshaman commented 4 years ago

I got this problem also: https://codepen.io/taurenshaman/pen/RwPJPzv There are two items linked to the right item. If you scroll down, the link of the bottom one didn't update position.

Here is another example, it has a horizontal scrollbar: https://lore.chuci.info/taurenshaman/mind/b87789af835a4c58b506084415d3ad5f

Thank you very much!

Arjun-Tamble-Infrrd commented 4 years ago

I got this problem also: https://codepen.io/taurenshaman/pen/RwPJPzv There are two items linked to the right item. If you scroll down, the link of the bottom one didn't update position.

Here is another example, it has a horizontal scrollbar: https://lore.chuci.info/taurenshaman/mind/b87789af835a4c58b506084415d3ad5f

Thank you very much!

For that you will have to use line.position() See position prop in the doc

anseki commented 4 years ago

@ArjunInfrrd, it seems that the example works fine. https://jsfiddle.net/a0Ltj7qs/

Hi @taurenshaman, thank you for the comment. That is not same issue as this issue. As @ArjunInfrrd said, you can solve that by reading the document.

taurenshaman commented 4 years ago

@ArjunInfrrd @anseki Thank you~~

anseki commented 4 years ago

:smile:

Arjun-Tamble-Infrrd commented 4 years ago

Hi @anseki ,

I'm actually displaying a lot of media files (like PDFs and images of bigger size) on a webpage and on top of that i'm using a leaderline on scroll of these media files. In this case, the leaderline is not smooth when scrolled though. May be due to heavy load on the page or something. I'm not exactly sure why its happening.

What's your view on this?

Thank you, Arjun

anseki commented 4 years ago

Could you reproduce that? I think that nobody can find the cause without looking. For example, could you add media files to the example that I wrote?

anseki commented 4 years ago

No reply came, then this abandoned issue is closed.