Viewing file: vscroller.php (1.81 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<html>
<head>
<link rel="StyleSheet" href="vscroller.css" type="text/css">
<title>ScriptBreaker.com :: Vertical text scroller</title>
<?php
require('conexion3.php');
$consul = "SELECT *
FROM indi"
. " order by intema";
$result = mysql_query($consul,$db);
$num_filas = mysql_num_rows($result);
$messi = "";
$say = 0;
while ($myrow = mysql_fetch_array($result))
{
$inid = $myrow["inid"];
$inname = $myrow["inname"];
$intema = $myrow["intema"];
$invalor = $myrow["invalor"];
$inunidad = $myrow["inunidad"];
$infuente = $myrow["infuente"];
$infecha = $myrow["infecha"];
$inlink = $myrow["inlink"];
$mey[$say] = "$intema, <a href='$inlink'>$inname</a> : $invalor $inunidad , Fuente: $infuente";
$say++;
}
?>
<script language="JavaScript">
var speed = 10
var step = 1
var width = 500
var delay = 2000
var pointer = 0
var stop;
var offset
var nus = <?php echo $say; ?>
if (nus == 2) {
var newsarray = ["<?php echo $mey[0] ?>","<?php echo $mey[1] ?>"]
}
if (nus == 1) {
var newsarray = ["<?php echo $mey[0] ?>"]
}
function pad(id,nr)
{
document.getElementById(id).style.left=nr;
nr-=step;
if(nr < - offset) setText(id)
else {
if((nr < 5) &&(stop == false)) {stop=true;setTimeout("pad('"+id+"',"+nr+")",delay);}
else setTimeout("pad('"+id+"',"+nr+")",speed);
}
}
function setText(id)
{
stop = false
document.getElementById("context").innerHTML = newsarray[pointer];
offset = document.getElementById("context").offsetWidth;
pointer++;
if(pointer >= newsarray.length) pointer = 0;
pad(id,width);
}
</script>
</head>
<body onload=setText("link")>
<div class=header>
<div id=link class="news">
<div id=context style="position:absolute"> -</div>
</div>
</div>
</body>
</html>
|