How to use event onmouseover to stop the scrolling on JS???

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
predolim
Forum Newbie
Posts: 5
Joined: Fri Jan 30, 2004 11:16 am
Location: São Paulo - Brazil

How to use event onmouseover to stop the scrolling on JS???

Post by predolim »

Hi.

I´m trying to use onmouseover event on the code below to stop the scrolling when the user point the mouseover the text and continue to scroll onmouseout event.

Could u help me??? TKS!

<?php
//Vamos precisar contar o MySQL novamente
include "conexao.php";
//$conexao = mysql_connect("localhost","predolim","521sad2ts46");
//$db = mysql_select_db("predolim");
//Agora é realizar a querie de busca no banco de dados
$sql = "SELECT * FROM noticias ORDER BY id DESC LIMIT 10";
// Irá selecionar as últimas 15 notícias inseridas
// O curioso aqui, é que ele só irá selecionar os campos onde
// estiver o ver=on, isto foi discutido logo atrás, como um
// controle de notícias pelo webmaster
// Por padrão o MySQL colocou off, mas o webmaster terá que
// revisar as notícias e alterar o campo ver para as que quiser validar.
$resultado = mysql_query($sql) or die ("Não foi possível realizar a consulta ao banco de dados");
$registro=mysql_fetch_array($resultado);
// Agora iremos "pegar" cada campo da notícia
// e organizar no HTML
$contenido = '';
while ($linha=mysql_fetch_array($resultado)) {
//Armar la noticia en varias tablas

//check the .=
//$contenido .= '<a href=javascript:stop(\"vernoticia.php?id='.$linha["id"].'\")>'.$linha["titulo"].'</a>'.'<br>'.'<br>';
$contenido .= '<a href=\"vernoticia.php?id='.$linha["id"].'\" target=_blank>'.$linha["titulo"].'</a>'.'<br>'.'<br>';
}



?>
<!-- saved from url=(0022)http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>::News::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="forms.css">

</head>

<body>
<table border=1 cellspacing=0 cellspanding=0 bgcolor="#C6E2FF">
<tr><td width="230" bgcolor="#0099FF" align="center"><font face=Verdana size=2 color="#000000"><b>Notícias</TD></TR>
<tr>
<td id="marqueecontents" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
<script language="JavaScript1.2">
//Specify the marquee's width (in pixels)
var marqueewidth=230
//Specify the marquee's height
var marqueeheight=230
//Specify the marquee's scroll speed (larger is faster)
//var speed=2
var scrollspeed=cache=2
//Specify the marquee contents
var marqueecontents='<?php echo $contenido; ?>'


if (document.all)
document.write('<marquee direction="up" scrollAmount='+scrollspeed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')


function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=scrollspeed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}

window.onload=regenerate2


</script>

<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02" width=&{marqueewidth}; height=&{marqueeheight}; ></layer>
</ilayer>
</td>
</tr>
</table>
</body>
</html>
Post Reply