Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Master_of_Word

Texto animado!!

Recommended Posts

Seguinte,

Divirta-se:

 

<script language="JavaScript" type="text/javascript"><!--

var news = new Array([ "Foguetes atingem região de quartel-general dos EUA em Bagdá" , "http://www1.folha.uol.com.br/folha/mundo/ult94u67137.shtml" ] ,

[ "Polícia turca apreende meia tonelada de explosivos" , "http://www1.folha.uol.com.br/folha/mundo/ult94u67136.shtml" ] ,

[ "Homem mantém refém tia de namorada em cidade satélite de Brasília" , "http://www1.folha.uol.com.br/folha/cotidiano/ult95u87731.shtml" ] ,

[ "Real Madrid volta a fazer pré-temporada na Ásia" , "http://www1.folha.uol.com.br/folha/esporte/ult92u69562.shtml" ] ,

[ "Preso morre em rebelião no Paraná" , "http://www1.folha.uol.com.br/folha/cotidiano/ult95u87730.shtml" ] ,

[]

) ;

 

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 = 65 ;

 

for (var i=0;i<news.length-1;i++){

t=news[0].replace(/\"/gi,'"');

if (t.length>title_max_size){

t = t.substring( 0 , title_max_size ) ;

t=t.substring(0,t.lastIndexOf(' '));

t+='...';

}

news[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>

<style type="text/css"><!--

body {margin: 10px 5px 0;}

a {color: #cc3300; font-family: verdana; font-size: 11px; font-weight: bold; line-height: 12px; text-decoration: none;}

--></style>

</head>

<body bgcolor="#ffffff" onload="begin_roll_ticker()">

<a href="#" id="ticker_anchor" target="_top" name="ticker_anchor"><div id="ticker"></div></a>

<script>

 

</script>

 

 

Agora, é possivel fazer isso em flash!!!

É mais pratico em termos de interatividade!!!

 

[]s

Rodney

Compartilhar este post


Link para o post
Compartilhar em outros sites

Seguinte,

Divirta-se:

 

<script language="JavaScript" type="text/javascript"><!--

var news = new Array([ "Foguetes atingem região de quartel-general dos EUA em Bagdá" , "http://www1.folha.uol.com.br/folha/mundo/ult94u67137.shtml" ] ,

[ "Polícia turca apreende meia tonelada de explosivos" , "http://www1.folha.uol.com.br/folha/mundo/ult94u67136.shtml" ] ,

[ "Homem mantém refém tia de namorada em cidade satélite de Brasília" , "http://www1.folha.uol.com.br/folha/cotidiano/ult95u87731.shtml" ] ,

[ "Real Madrid volta a fazer pré-temporada na Ásia" , "http://www1.folha.uol.com.br/folha/esporte/ult92u69562.shtml" ] ,

[ "Preso morre em rebelião no Paraná" , "http://www1.folha.uol.com.br/folha/cotidiano/ult95u87730.shtml" ] ,

[]

 

...

só, não mais nada de código.... Imagem PostadaImagem Postada

 

valeu pela mão Douglas e sitenovo. Imagem PostadaImagem Postada

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.