anyone have some tips on how to make text inside a div scroll horizontally from right to left in a \"news ticker\" fashion without having to use a plugin. Here is an example of
Here's a quick solution to this: http://jsfiddle.net/4mTMw/8/
var marquee = $('div.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));
});
Using the text-indent
css property, you can do this rather simply.