Docs / Libraries / Rinx
rinx.js
Rinx
A text/card rotator for showcasing one block at a time — great for testimonials or marquees.
Initialization
const state = rinx.slides({ IDs, interval, effect });
| Option | Default | Description |
|---|---|---|
IDs | [] | Array of element IDs to rotate through. |
interval | 3000 | Time each item stays visible (ms). |
effect | "fade" | "fade" or "slide" transition. |
Example
<div id="quotes">
<p id="scroll1">"Fast and tiny." — Ada</p>
<p id="scroll2">"Love the signals." — Lin</p>
<p id="scroll3">"Ships in minutes." — Tim</p>
</div>
rinx.slides({
IDs: ['scroll1', 'scroll2', 'scroll3'],
interval: 5000,
effect: 'slide'
});
Methods
| Method | Description |
|---|---|
destroyAll() | Clears all running intervals and resets instances. |
slides() returns the rotator state (with its timer), and registers it in rinx._instances so destroyAll() can stop everything.