I am trying to implement horizontal scroll on my app. I have come across several examples, but none of them seem to fit my specific needs. The code snippet below is one that I thought would work, but it's not functioning as expected. Can someone please help me identify the issue?
<!DOCTYPE html>
<html>
<head>
<style>
div.marquee {
white-space:no-wrap;
overflow:hidden;
}
div.marquee > div.marquee-text {
white-space:nowrap;
display:inline;
width:auto;
}
</style>
<script>
var marquee = $('div.marquee');
console.log(marquee);
marquee.each(function() {
var mar = $(this),indent = mar.width();
mar.marquee = function() {
indent--;
mar.css('text-indent',indent);
if (indent < -1 * mar.children('div.marquee-text').width()) {
indent = mar.width();
}
};
mar.data('interval',setInterval(mar.marquee,1000/60));
});
</script>
</head>
<body>
<div class='marquee'>
<div class='marquee-text'>
Testing this marquee function
</div>
</div>
</body>
</html>
Update: There are no errors in the console. https://i.sstatic.net/jSkDh.png