Home > Javascript > Minimal Text Slider With Pure JavaScript – TxSlider
Minimal Text Slider With Pure JavaScript – TxSlider

Minimal Text Slider With Pure JavaScript – TxSlider

Txslider is js library for sliding text on web pages.
TxSlider is a really simple and lightweight JavaScript library for rotating through an array of text objects with various effects.
Usage

To put this to work first add this lines of Css (you can add more styles but try not to change ‘position’ & ‘overflow’):

#tx {
height: 20px;
width: 300px;
position: absolute;
overflow: hidden;
border-bottom: 1px solid black;
}
Then create a div with id of tx:

Add your data you want to show in var data:

var data = [
{
text: “Hello world”
}, {
text: “Lorem ipsum dolor.”
}, {
text: “Numbers 1234567”
}, {
text: “Hosein2398”
}, {
text: “Nice!”
}
];
And config it as you wish:

var tx_conf = {
infinit: true,
effect: “flash”,
timer: 2
//dir : “rtl”
//stayIn: 1
}

  Website Demo

About admin