Parallax
Angular Bootstrap 5 Parallax plugin
Parallax is a plugin that adds scrolling effect animation for your images.
Responsive Parallax plugin built with the latest Bootstrap 5. Many customization examples of scrolling effect images animation like scroll delay, scroll direction.Note: Read the API tab to find all available options and advanced customization
Basic example
Use mdb-parallax
selector to render parallax image, and
provide path to your image with [imageSrc]
input
Direction
Change parallax scroll direction with [direction]
input
Combine horizontal and vertical directions
Delay
Change delay of the scroll with [delay]
input
Scale
Change scale of the image with [scale]
input
Scroll transition
Change default scroll transition timing function with [transition]
input
Max transition
Change maximum scroll value of the image with [maxTransiton]
input.
Give values within 0-100 range
Max image height
Set maximal parallax container height with [maxHeight]
input
Image alignment
Horizontal and vertical alignment of the image is set to center by default. Change horizontal
alignment with [horizontalAlignment]
and vertical with
[verticalAlignment]
(vertical alignment will only work with
[maxHeight]
set)
Image horizontally aligned
Image vertically aligned
Container overflow
Make parallax overflow its container with [overflow]
input
Parallax with content
Place any content inside the parallax by adding div
with class
parallax-content
and your content inside parallax container
Parallax content
Some quick example text to show you possibilites of the parallax element.
Parallax - API
Installation
To install and configure the plugin follow our Plugins Installation Guide. Please remember to update all the plugin names and import paths. You can find all the necessary information in the Import section.
Import
Inputs
Name | Type | Default | Description |
---|---|---|---|
imageSrc
|
String | ' |
Sets image source for parallax component. Obligatory to instantiate the component. |
direction |
String | 'up' |
Sets direction in which the image will be translated when scrolling down the page. Possible settings: up | right | down | left | up left | up right | down left | left right. |
delay
|
Number | 0.4 |
Sets the time in seconds in which translation of the image will still be going after the user stops scrolling. |
scale
|
Number | 1.3 |
Sets scale of the image. The higher the scale is set, the bigger parallax scroll
effect will be visible, but the image will lose in quality. To keep the image quality
choose higher resolution images or limit the height of the parallax container with
[maxHeight] input.
|
transition
|
String | 'cubic-bezier(0,0,0,1)' |
Sets transition timing function for parallax scroll efect. Can receive timing functions such 'ease', 'linear', 'cubic-bezier'. |
maxTransition
|
Number | 0 |
When [maxTransition] is set, parallax animation will stop after
given percentage of user viewport is scrolled.
|
maxHeight
|
Number | 0 |
Sets maximal height of the parallax container. |
horizontalAlignment
|
String | 'center' |
Determines which horizontal part of the image will be more visible during the parallax effect. Possible settings: right | left | center |
verticalAlignment
|
String | 'center' |
Determines which vertical part of the image will be more visible during the parallax
effect. Works only when [maxHeight] is set. Possible settings:
top | bottom | center
|
overflow
|
Boolean | false |
When set to true, the parallax image will translate out of its container and will overlap content on the page. |