Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá!No site da folhaonline.com.br tem um sistema que exibe as últimas notícias de um modo bem interessante.Elas vem "rolando", tipo assim:LULA QUER C_LULA QUER CO_LULA QUER COM_LULA QUER COMP_LULA QUER COMPR_Queria saber como que eu faço para incluir algo desse tipo no meu site.Obrigado! :)
Tente assim:
<meta http-equiv=refresh content=600;URL=index.php><script language="JavaScript" type="text/javascript"><!--var news = new Array([ "aqui noticia" , "aqui link" ] ,[ "aqui noticia2" , "aqui link2" ] ,[ "aqui noticia3" , "aqui link3" ] ,[ "aqui noticia4" , "aqui link4" ] ,[ "aqui noticia5" , "aqui link5" ] ,[]);var ticker_layer = false;var step_time = 25;var freeze_time = 2000;var news_index = 0;var title_index = 0;var end_title = "_";var title_max_size = 50;for (var i=0;i<news.length-1;i++){ t=news[i][0].replace(/\"/gi,'"'); if (t.length>title_max_size){ t = t.substring( 0 , title_max_size ); t=t.substring(0,t.lastIndexOf(' ')); t+='...'; } news[i][0]=t;}function begin_roll_ticker(){ window.setTimeout( "roll_ticker()" , step_time );}function roll_ticker(){ var title; if ( title_index == 0 ){ while ( document.getElementById('ticker').lastChild != null ){ child = document.getElementById('ticker').lastChild; document.getElementById('ticker').removeChild( child ); } } if ( news.length > news_index + 1 && news[news_index][0].length >= title_index ){ title = news[ news_index ]; document.getElementById('ticker_anchor').setAttribute( "href" , title[1] ); s_text = title[0].substring( title_index , title_index + 1 ); title_index++; if ( document.getElementById('ticker').lastChild != null ){ if ( document.getElementById('ticker').lastChild.nodeValue == "_" ){ child = document.getElementById('ticker').lastChild; document.getElementById('ticker').removeChild( child ); } } txt = document.createTextNode( s_text ); document.getElementById('ticker').appendChild( txt ); if ( title[0].length > title_index ) { if ( title_index % 10 != 0 ){ txt = document.createTextNode( "_" ); document.getElementById('ticker').appendChild( txt ); } } window.setTimeout( "roll_ticker()" , step_time ); } else{ news.length == news_index + 2 ? news_index = 0 : news_index++; title_index = 0; window.setTimeout( "roll_ticker()" , freeze_time ); }}//--></script></head><style>A:LINK {color : #009999;}A:VISITED {color : #009999;}A:ACTIVE {color : gray;}A:HOVER {color : gray;}A {text-decoration: none}V {text-decoration: none}</style><body onLoad="begin_roll_ticker()" link="#ffcc66" vlink="#ffcc66" alink="#ffcc66"><font face="Verdana" color="#ffcc66" size="2"><b><a href="#" id="ticker_anchor" target="_top" name="ticker_anchor"><div style="position: absolute; width: 355px; height: 25px; z-index: 3; left:73px; top:19px" id="ticker"> </div></a></b></font><table border="0" width="450" id="table1" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td bgcolor="#FFFFFF"> </td> </tr></table>O do Adailton Funcionou, mas eu tive que por o id no marquee, ficando:
<marquee id="news" class="pdpreto" direction="up" behavior="scroll" width="650" vspace="6" hspace="0" height="15" loop="-1" scrollamount="2" scrolldelay="200" truespeed onMouseOver="scrollstop()" onMouseOut="scrollplay()">//AQUI você COLOCA A NOTICIA VINDA DO BD</marquee>
pelo que entendi ele não quer rolar as noticias.. seria aquele efeito que as noticias vão passar uma por uma numa linha somente... teste como citei no post acima que acho que é isso..
Sim... pelo oque entendi ele quer assim
Em nenhum dos modos o texto fez esse efeito!!Me ajudem por favor =)