About
ReplaceMe.js is a lightweight text rotator written in vanilla JS, but it can be used with jQuery.
ReplaceMe.js is a lightweight text rotator written in vanilla JS, but it can be used with jQuery.
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<p>I am <span class="replace-me">Designer,Developer,Photographer</span></p>
Also, you can put other values in hidden span
<p>I am <span class="replace-me">Designer<span style="display:none">,Developer,Photographer</span></span></p>
<script src="replaceme.min.js"></script><script>
var replace = new ReplaceMe(document.querySelector('.replace-me'));
</script>
If you want to declare custom options:
<script src="replaceme.min.js"></script>
<script>
var replace = new ReplaceMe(document.querySelector('.replace-me'), {
animation: 'animated fadeIn', // Animation class or classes
speed: 2000, // Delay between each phrase in miliseconds
separator: ',', // Phrases separator
hoverStop: false, // Stop rotator on phrase hover
clickChange: false, // Change phrase on click
loopCount: 'infinite', // Loop Count - 'infinite' or number
autoRun: true, // Run rotator automatically
onInit: false, // Function
onChange: false, // Function
onComplete: false // Function
});
</script>
Also you can use jQuery:
<script src="replaceme.min.js"></script>
<script>
var replace = $('.replace-me').ReplaceMe();
</script>
var replace = new ReplaceMe();
replace.start();
replace.stop();
replace.pause();
replace.change();
All modern browsers and IE10+
bower install replaceme --save
ReplaceMe.js is licensed under the MIT license