Perfect-scrollbar: Dynamically scroll content

Created on 10 May 2016  路  3Comments  路  Source: mdbootstrap/perfect-scrollbar

I'm using your plugin for my real-time chat app, and I have implemented a search engine in it (Viber-like, if you use Viber on PC, you will know).

For example, you search for "meeting", the chat has 5 mentions of the word "meeting", and you want to jump one-by-one found phrases. There is only scrollTop(offset) method which doesn't really provide the solution here, except if I do more heavy operations calculating "distance" (in px) between found search terms and then passing the value to scrollTop method.

Do you maybe have any advice on this approach?

Thanks in advance,
Eddie

Most helpful comment

Hmm, I still think this is not to be implemented in PS. PS is just a scrollbar emulator, not about scrolling action itself. PS use the default scrollTop and scrollLeft, so you may consider using it with other scrolling libraries supporting this feature or implementing it.

I'm really sorry that I cannot help so much. I close this issue now, but I always welcome discussion. Please feel free to leave any comment.

Thanks!

All 3 comments

Currently there is no easy way to do this in PS. I would suggest implementing it, as you said, by calculating offset top of the texts and setting offsetTop to it.

It need for me too.

Hmm, I still think this is not to be implemented in PS. PS is just a scrollbar emulator, not about scrolling action itself. PS use the default scrollTop and scrollLeft, so you may consider using it with other scrolling libraries supporting this feature or implementing it.

I'm really sorry that I cannot help so much. I close this issue now, but I always welcome discussion. Please feel free to leave any comment.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julmot picture julmot  路  8Comments

corysimmons picture corysimmons  路  6Comments

hatashiro picture hatashiro  路  4Comments

jaycbrf4 picture jaycbrf4  路  6Comments

cmer picture cmer  路  3Comments