I want horizontal scroll on my app. there are multiple example, but I found one that fit my need. But when i try it it just don't work as it should. please look and tell me what the problem is:
<!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>