* Adds or subtracts the slider width to the provided position. * * @param position - A position to shift. * @param backwards - Determines whether to shift the slider backwards or forwards. * * @return The shifted position.
( position: number, backwards: boolean )
| 155 | * @return The shifted position. |
| 156 | */ |
| 157 | function shift( position: number, backwards: boolean ): number { |
| 158 | const excess = position - getLimit( backwards ); |
| 159 | const size = sliderSize(); |
| 160 | position -= orient( size * ( ceil( abs( excess ) / size ) || 1 ) ) * ( backwards ? 1 : -1 ); |
| 161 | return position; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Cancels transition. |