vue-scroll-progress-bar icon indicating copy to clipboard operation
vue-scroll-progress-bar copied to clipboard

new functionality - DOM selector handler

Open J4si3k opened this issue 4 years ago • 4 comments

Hello, I really like your plugin, however I would like to ask you to add new functionality. Could you add the option of adding a handler on a given DOM element? I would like to use your plugin on the blog, and the scrollbar position to refer to the article text, but when the page has article, sidebar and footer then the scrollbar measures the entire page, not what the user is interested in - the length of the article. For e.g.

<vue-scroll-progress-bar handler=".post-article" @complete="handleComplete" height="2rem" />

I think this is a nice option. Hold on!

J4si3k avatar Jun 09 '20 16:06 J4si3k

That would be great! Could you open a PR with a basic implementation until I take a look?

Thanks

guillaumebriday avatar Jun 09 '20 16:06 guillaumebriday

That would be great! Could you open a PR with a basic implementation until I take a look?

Thanks

ok, I will try tommorow ;-)

J4si3k avatar Jun 09 '20 16:06 J4si3k

Hey @J4si3k did you have time to work on that?

Thanks

guillaumebriday avatar Jun 15 '20 07:06 guillaumebriday

Hey @J4si3k did you have time to work on that?

Thanks

I tried a little but I had a problem calculating the ratio of the selected element to the height of the scroll. Unfortunately, I had to deal with another topic but I plan to make a second attempt. I also looked at other libraries or snippets and did not find such an approach. The whole height is measured everywhere :-)

J4si3k avatar Jun 15 '20 07:06 J4si3k