Hi, In my site I use marquee tag. My problem is that this tag is not standart. There is alternative in javascript? TIA.
That's right, but you don't have to use a marquee tag. It's only there for people without Javascript. This is valid code that has no marquee tag, but the marquee function still works: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <head profile='http://gmpg.org/xfn/11'> <title>Marquee Demo</title> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script> <script type='text/javascript' src='jquery.marquee.js'></script> <script type='text/javascript'> $(function () { $('#foo').marquee(); }); </script> </head> <body> <div id='foo'>This is a really long string to test the jQuery marquee plugin.</div> </body> </html> Code (markup):
You can add direction attribute to the DIV, but the code will not validate. <div id='foo' [COLOR="red"]direction='right'[/COLOR]>This is a really long string to test the jQuery marquee plugin.</div> Code (markup): OR Open the script, go to line 103 and change 'left' to 'right'. direction = ($marquee.attr('direction') || '[COLOR="red"]right[/COLOR]').toLowerCase(), Code (markup): Not good to hack scripts, but it's only way I can make it work and validate.
thanks. P.S. are the plugin is Free License? I can use it free in my site and change this? and thanks again. edit: its not work.
Check that you have links to the jQuery library and marquee script in the head section. <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script> <script type='text/javascript' src='jquery.marquee.js'></script> Code (markup): Also, check that the marquee script is in the same directory as the page. That may be a problem if you are using Wordpress or other CMS. That's all I can do without a site link or some code.
Use this code friend <marquee onMouseover="this.scrollAmount=3" onMouseout="this.scrollAmount=6">Scrolling text here. Scrolling text here</marquee>