📜 ⬆️ ⬇️

Vertical scrolling with brief information.

Once upon a time, I do not remember where I read that the usual scrolling can be made more functional and a number of solutions were proposed.
I liked these ideas and now many years later:) ...
I offer my implementation on javascripte. The idea is to show a sketch of the entire text on the background of the scrolling, and with the help of the scrolling engine the visible part of the text. With this approach, you can immediately see where the picture, title, and where the paragraph.

I didn’t see this implementation on javascripte and honestly say and didn’t look, I like to do everything with my own hands :).

Initialization is just like in a tank :). Create a scroll object by passing the id or the block itself (div) into the constructor and options.
In the options you can specify:
step - scrolling step in px by default 50
keyEvent - Play the keys Home, End, Page Up, Page Down enabled by default

var scrolPanel = new scroll.ScrollPanel('test',o);

')
You can see the demo here. You can download the source here.

All this disgrace was made on the basis of my own bike, so I made a version in which all the extra parts were removed, pressed and put in one box. You will find this file in the archive under the name scroll-full.js. The ability to create a scroll using jQuery if you have it connected is also added to this file, like so $ ('# test'). ScrollPanel (o);

Source: https://habr.com/ru/post/44540/


All Articles