On Apr 27, 3:57 pm, "Fabyo Guimaraes" <[EMAIL PROTECTED]> wrote: > Use jquery = ) > > $(document).ready(function() { > $("#news").newsTicker();} > > ); > > function showdiv() { > $("#news").css("display", "block"); > > } > > function hidediv() { > $("#news").css("display", "none"); > > } > > function replacecontents() { > $("#news").html("<li>Replaced 1</li><li>Replaced 2</li><li>Replaced > 3</li><li>Replaced 4</li>"); > > }
This is what I would do: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/ html;charset=ISO-8859-1" /> <title>Untitled Document</title> <style type="text/css"> .newsticker { list-style-type: none; list-style-position:outside; padding:0 0 0 0; margin:0 0 0 0; font-family:"Lucida Grande", Geneva, Arial, Helvetica, sans- serif; font-size:12px; color:#000; } </style> <script type="text/javascript" src="jquery-1.1.2.js"></script> <script type="text/javascript" src="jquery-newsticker.js"></script> <script type="text/javascript"> var news; $(document).ready( function() { news = $("#news"); news.newsTicker(); $("#show").click(shownews); $("#hide").click(hidenews); $("#replace").click(replacenews); } ); function shownews() { news.show(); } function hidenews() { news.hide(); } function replacenews() { info='<li>Replaced 1</li><li>Replaced 2</li><li>Replaced 3</ li><li>Replaced 4</li>'; news.html(info); news.newsTicker(); } </script> </head> <body> <ul id="news"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul> <input type="button" value="Show" id="show" /> <input type="button" value="Hide" id="hide" /> <input type="button" value="Replace" id="replace" /> </body> </html>