Class osmplayer.scroll
Extends
minplayer.display.
This class provides the scroll functionality for the playlists.
We can calculate how the scrollbar controls the playlist using the
following diagram / equations.
___ ____________
| | |\
| | list | \
| | |y \
| | | \
| |____________| \ _ _____
| | |\ | | |
| | | \ | | |
| | | \ | |x |
| | | \ | | |
| | | \|_|_ |
| | | | | | |
l | window | | | h w
| | | |_|_| |
| | | /| | |
| | | / | | |
| | | / v| | |
| | | / | | |
| |____________|/ |_|____|
| | | /
| | | /
| | | /
| | | /
|__|____________|/
l - The list height.
h - Handle Bar height.
w - Window height.
x - The distance from top of window to the top of the handle.
y - The disatnce from the top of the list to the top of the window.
v - The distance from bottom of window to the bottom of the handle.
jQuery UI provides "v". We already know "l", "h", "w". We can then
calculate the relationship between the scroll bar handle position to the
list position using the following equations.
x = (w - (v + h))
y = ((l - w)/(w - h)) * x
-- or --
y = ((l - w)/(w - h)) * (w - (v + h))
We can statically calculate the ((l - w)/(w - h)) as a ratio and use
that to speed up calculations as follows.
ratio = ((l - w)/(w - h));
So, our translation equations are as follows...
y = ratio * (w - (v + h))
v = w - (h + (y / ratio))
Defined in: osmplayer.scroll.js.
Constructor Attributes | Constructor Name and Description |
---|---|
osmplayer.scroll(context, options)
|
Field Attributes | Field Name and Description |
---|---|
Reset the constructor.
|
- Fields borrowed from class minplayer.plugin:
- context, lock, name, options, pluginReady, queue, triggered
Method Attributes | Method Name and Description |
---|---|
getHandlePos(pos)
|
|
getMousePos(event)
|
|
getPos(handlePos)
|
|
onResize()
Refresh all the variables that may change.
|
|
refresh()
Refreshes the scroll list.
|
- Methods borrowed from class minplayer.display:
- fullscreen, fullScreenElement, getDisplay, getElements, getScaledRect, isFullScreen, toggleFullScreen
- Methods borrowed from class minplayer.plugin:
- addPlugin, bind, checkQueue, create, destroy, get, isValid, poll, ready, trigger, unbind
- Parameters:
- {object} context
- The jQuery context.
- {object} options
- This components options.
- Parameters:
- pos
- Parameters:
- event
- Parameters:
- handlePos