I am trying to use the following marquee code that I found on Stack-Overflow:
Javascript Marquee to replace <marquee> tags
The full source code example here:
https://www.sanwebcorner.com/2016/07/marquee-text-without-marquee-tag-using.html
I would like to convert the jQuery animate to pure JavaScript (I'm thinking JavaScript animate).
The jQuery code is as follows:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.scrollingtext').bind('marquee', function() {
var ob = $(this);
var tw = ob.width();
var ww = ob.parent().width();
ob.css({ right: -tw });
ob.animate({ right: ww }, 20000, 'linear', function() {
ob.trigger('marquee');
});
}).trigger('marquee');
});
</script>
<div class="scroll">
<div class="scrollingtext"> Flash message without marquee tag using javascript!</div>
</div>
The marquee works quite well, but I am trying to avoid the overhead of jQuery and use pure JavaScript.