You can override them after including the base slider style file:
`html ...
`
The currently active slide is assigned the class «rxslider__active». This allows you to create simple effects for slides, for example:
`html ...
`
For an active navigation button, the class «rxslider__nav-active» is used.
The slider takes four attributes. The data-stop attribute without a value disables auto-scrolling:
`html
`
Attribute data-back without value, changes the scrolling direction of the slider. By default, the slider scrolls to the right, but this can easily be changed:
`html
`
The data-time attribute specifies the number of milliseconds the slider will pause before moving on to the next slide. By default, this value is 3000 milliseconds, but you can change it:
`html
`
The data-sens attribute determines how sensitive the slider is when dragging to the next/prev slide. By default, this value is 10. The higher this value, the less distance you need to drag the slide:
`html
`
A document can have multiple sliders. By default, sliders are center-aligned and stretch to the full width of the parent element.
To limit the maximum width of any slider, simply add an inline style to it:
`html
`
$3
By default, slides scroll without changing their appearance. A slider allows you to define complex effects applied to its slides.
Slides are all child elements that are inside an element with the class «rxslider__slides»:
`html
`
Slides do not have their own classes. They are used as an unnamed container and contain other elements, such as images, as in the example above.
To create effects, predefined CSS variables are used, which are stored in the rxslider-vars.css file. This file must be included after the basic slider styles:
`html ...
`
The file defines several variables for properties that are most suitable for applying effects. Their names correspond to the names of the properties whose values they define.
For example, the transition property has the variable "--transition", as shown below:
The same number of variables exist for the parent of the slides, i.e. for the «rxslider__slides» element. Their names start with the prefix "--parent" followed by the name of the property:
The same number of variables exist for direct children of slides, such as images. Their names start with the prefix "--child" followed by the name of the property:
You can define new variables in the rxslider-vars.css file for any properties you want to use when creating effects, for example:
`css text-align: var(--text-align, revert); `
All these variables allow you to define properties for the parent, slide and its direct child in a special class that is added after the base styles are connected.
Its name consists of the name of the slider class, a double dash, like variables, and an arbitrary custom effect name, for example:
Variables define property values before assigning a special class to the active slide in the window, and properties set explicitly in the class, after this class is added to it.
In this way, you can create a large number of different effects, as shown below: