* Checks if there is enough width to shift the slider. * * @param backwards - `true` for checking backwards, or `false` for doing forwards. * * @return `true` if the slider can be shifted for the specified direction, or otherwise `false`.
( backwards: boolean )
| 264 | * @return `true` if the slider can be shifted for the specified direction, or otherwise `false`. |
| 265 | */ |
| 266 | function canShift( backwards: boolean ): boolean { |
| 267 | const shifted = orient( shift( getPosition(), backwards ) ); |
| 268 | return backwards |
| 269 | ? shifted >= 0 |
| 270 | : shifted <= list[ resolve( 'scrollWidth' ) ] - rect( track )[ resolve( 'width' ) ]; |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Checks if the provided position exceeds the minimum or maximum limit or not. |