Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/09/2011, 17:26
isabelramirezmontoya
 
Fecha de Ingreso: noviembre-2010
Mensajes: 204
Antigüedad: 13 años, 5 meses
Puntos: 1
Respuesta: Como puedo hacer......

ocp001a, gracias por tu colaboracion

Entiendo lo que me dices pero no se como hacerlo, la verdad es que apenas estoy aprendiendo este cuento de la programacion.

Cuando hago la consulta la funcion se activa, pero cuando la consulta llega no se como quitar la funcion, la funcion sigue funcionando y la consulta queda sobre o debajo de la funcion.

El codigo HTML que estoy intentando es el siguiente:

<html>
<head>

<script language="javascript" src="xp_progress.js"></script>

<style type="text/css">

table.tabla1
{
margin-top: 300px;
margin-bottom: 10px;
margin-right: 10px;
margin-left: 400px;
border: 0px solid green;
width: 200px;
height: 40px;
}

td.td1
{
text-align: center;
font-weight: regular;
font-family:Arial, Helvetica, sans-serif;
font-size:10pt;
height: 20px;
background-color:#FFFFFF;
color:#008000;
}

</style>

</head>

<body>

<script>

function procesando(id){
mostrado=0;
elem = document.getElementById(id);
if(elem.style.display=='block')mostrado=1;
elem.style.display='none';
if(mostrado!=1)elem.style.display='block';
}

</script>

<div id="tabla1" style="display: none">

<table class="tabla1" cellpadding="0" cellspacing="5">
<tr>
<td class="td1" align="center">
<script type="text/javascript">
var bar=createBar(150,15,"white",1,"black","#333366",8 5,7,3,"");
</script>
</td>
</tr>
<tr>
<td class="td1" align="center">Procesando....</td>
</tr>
</table>

</div>

<script>
procesando('tabla1')
</script>

<table>

<?
$host="ABC";
$user="ABC";
$password="ABC";
$db="foro1";

$connect=mysql_connect($host,$user,$password);
mysql_select_db("foro1",$connect);
$consulta = mysql_query("select direccion, nombre, fecha from libreta order by direccion asc",$connect);
$lado=mysql_num_rows($consulta);

while($row = mysql_fetch_array($consulta)) {

echo '<tr><td><p><b>Nombre:</b>'.$row["nombre"].'</p></td><td><p><b>Direccion:</b>'.$row["direccion"].'</p></td><td><p><b>Fecha:</b>'.$row["fecha"].'</p></td></tr>';

}

mysql_free_result($consulta);

mysql_close();

?>

</body>
</html>

El codigo JAVASCRIPT que estoy usando es el siguiente:


var w3c=(document.getElementById)?true:false;
var ie=(document.all)?true:false;
var N=-1;

function createBar(w,h,bgc,brdW,brdC,blkC,speed,blocks,coun t,action){
if(ie||w3c){
var t='<div id="_xpbar'+(++N)+'" style="visibility:visible; position:relative; overflow:hidden; width:'+w+'px; height:'+h+'px; background-color:'+bgc+'; border-color:'+brdC+'; border-width:'+brdW+'px; border-style:solid; font-size:1px;">';
t+='<span id="blocks'+N+'" style="left:-'+(h*2+1)+'px; position:absolute; font-size:1px">';
for(i=0;i<blocks;i++){
t+='<span style="background-color:'+blkC+'; left:-'+((h*i)+i)+'px; font-size:1px; position:absolute; width:'+h+'px; height:'+h+'px; '
t+=(ie)?'filter:alpha(opacity='+(100-i*(100/blocks))+')':'-Moz-opacity:'+((100-i*(100/blocks))/100);
t+='"></span>';
}
t+='</span></div>';
document.write(t);
var bA=(ie)?document.all['blocks'+N]:document.getElementById('blocks'+N);
bA.bar=(ie)?document.all['_xpbar'+N]:document.getElementById('_xpbar'+N);
bA.blocks=blocks;
bA.N=N;
bA.w=w;
bA.h=h;
bA.speed=speed;
bA.ctr=0;
bA.count=count;
bA.action=action;
bA.togglePause=togglePause;
bA.showBar=function(){
this.bar.style.visibility="visible";
}
bA.hideBar=function(){
this.bar.style.visibility="hidden";
}
bA.tid=setInterval('startBar('+N+')',speed);
return bA;
}}

function startBar(bn){
var t=(ie)?document.all['blocks'+bn]:document.getElementById('blocks'+bn);
if(parseInt(t.style.left)+t.h+1-(t.blocks*t.h+t.blocks)>t.w){
t.style.left=-(t.h*2+1)+'px';
t.ctr++;
if(t.ctr>=t.count){
eval(t.action);
t.ctr=0;
}}else t.style.left=(parseInt(t.style.left)+t.h+1)+'px';
}

function togglePause(){
if(this.tid==0){
this.tid=setInterval('startBar('+this.N+')',this.s peed);
}else{
clearInterval(this.tid);
this.tid=0;
}}

function togglePause(){
if(this.tid==0){
this.tid=setInterval('startBar('+this.N+')',this.s peed);
}else{
clearInterval(this.tid);
this.tid=0;
}}


Cualquier colaboracion, comentario o sugerencia mil gracias.

Isabel Ramirez