views:

426

answers:

2

What is the lightest left-right scrolling marquee around?

I would prefer if it 'bounced'... by that I mean rather than going around in a loop it would be better that it scrolled left until it was all shown and then scrolled right.

I know its kinda retro... I am thinking of using it instead of truncating text.

Thanks.

+2  A: 

I suggest the Silky Smooth Marquee.

It uses the standard html marquee tag, so it will work without javascript enabled. However, with javascript enabled, it uses jquery to enhance the marquee and provides many customization options.

Here's the demo page.

Peter Di Cecco
cheer's man... looks great
Mark
enjoy! but remember, geocities has died... :P
Peter Di Cecco
and `<marquee>` and `<blink>` are hugely responsible :P
Anurag
A: 

You should be able to do this quite simple with jquery and some css:

// HTML 
<div id="myWrapperID" style="width: 300px;">
<div id="myElementID" style="float:left">[Lorem ipsum]</div>
</div>


// JS
(function (){
var ml,
    elem = $('#myElementID'),
    maxMarginLeft = $('#myWrapperID').width() - elem.width(),
    doMarquee = function () {
        ml = parseInt(elem.css('marginLeft'), 10) === 0 ? maxMarginLeft : 0;
        elem.animate({ marginLeft: ml + 'px' }, doMarquee);
    }

elem.css('marginLeft', '0px');
    doMarquee();    
}());
fredrik
Does this code actually work? I can't get it to do anything.
Nathan Taylor
Just test ran it. Works. Do you get any errors?
fredrik