Caminho de Navegação Javascript / Artigos / Scroll Automático

Nenhuma avalição
Indique ao Ueba Indique ao BlogBlogs Indique ao Delicious Indique ao Technorati Indique ao Google Bookmarks Indique ao Newsgator
TAGS

Nenhuma tag foi definida ainda!

Defina as tags para esta página preenchendo o campo abaixo.

  • Máximo de 100 tags
  • Cada tag deve ter até 20 caracteres.
  • Separar as tags com virgula. Ex.: php, sql, html, xml, fireworks
COMENTAR

INDICAR
Nome do amigo: E-mail do amigo: Comentário:
REPORTAR ERRO Descreva o erro:

Scroll AutomáticoPostada em: 10/09/2004

João Netto
Por: João Netto Nº de Visualizações: 3255.



Cole o código em sua página, nessa mesma ordem:


<!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>
<title>Exemplo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
 



.estilo1 {
        font-family:Arial, Helvetica, sans-serif;
        font-size:14px;
}
 



</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" height="100%">
  <tr>
    <td>
      <div id="Layer1" style="border:1px solid #000000; width:100%; height:100%; overflow:hidden;" onmouseover="speedy=0" onmouseout="speedy=1; Mover()">
        <div id="Layer2" style="position:absolute; left:0px; top:0px; width:100%; height:100%; background-color:#FFFFCC;">
          <br />
          <p align="center" class="estilo1"><strong>ScriptFácil</strong></p>
          <p align="center" class="estilo1">aqui entra o conteúdo.</font></p>
          <p align="center" class="estilo1">colocando o mouse na parte amarela, o menu para.</font></p>
          <p align="center" class="estilo1">tirando o mouse, o menu rola.</font></p>
        </div>
      </div>
    </td>
  </tr>
</table>

<script language="javascript">
 



var top, base, pos, speedy;
speedy = 1;

function Iniciar() {
        top = (document.getElementById('Layer2').offsetHeight + 3);
        base = (0 - (document.getElementById('Layer2').offsetHeight + 3));
        pos = parseInt(document.getElementById('Layer2').style.top);
        Mover();
}
function Mover() {
        pos = (pos - 2);
        document.getElementById('Layer2').style.top = pos;
        if (pos < base) {
                pos = top;
        }
        if (speedy == 1) {
                setTimeout(function() {
                        Mover();
                }, 100);
        }
}
window.onload = Iniciar();
 



</script>

</body>
</html>