Título: java script con php
Publicado por: cyberherles en 5 Octubre 2010, 07:18 am
mi problema es el siguiente no si esta es la sección por mi problema, aver les explico tengo el codigo que esta abajo que x ai lo busque pero cuando le pongo una url a la noticia en scroll horizontal de noticias no me sale el enlace...creo q el script lo bloquea...aver vean al codigo... <style type="text/css"> #noticia1, #noticia2, #noticia3 { position:absolute; width:575px; height:210px;
} #noticia1 { opacity: 1; -moz-opacity: 1; -khtml-opacity: 1000; filter: alpha(opacity=100);} #noticia2, #noticia3 { opacity: 0; -moz-opacity: 0; -khtml-opacity: 0; filter: alpha(opacity=0); } #noticia1 { ; } #noticia2 { ; } #noticia3 { ; } </style> <script type="text/javascript"> function opacity(id, opacStart, opacEnd, millisec) { //velocidad de cada frame var speed = Math.round(millisec / 100); var timer = 0; //determinamos la dirección del fundido, si star y end son iguales no hace nada if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //modificamos la opacidad según los distintos navegadores function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } //cambiamos en un fadein/fadeout dos div function intercambiar(muestra, oculta) { opacity(muestra,0,100,4000); opacity(oculta,100,0,4000); } //Establacemos los tiempos de ejecución de las alternancias function alternar() { setTimeout("intercambiar('noticia2','noticia1')",8000); setTimeout("intercambiar('noticia3','noticia2')",16000); setTimeout("intercambiar('noticia1','noticia3')",24000); } </script> </head> <body> <script type="text/javascript"> //hacemos la primera alternancia alternar(); //y repetimos cada x segundos, según el número de div's y segundos que se tarde setInterval("alternar()",24000); </script>
<table width="585" border="0" cellspacing="0" cellpadding="7"> <tr> <td height="15" bgcolor="#4499EC"><span class="Estilo2"><strong> NOTICIAS</strong></span></td> </tr> <tr> <td valign="top">
<div id="noticia1">
<?
include("config.php") ;
$resp1 = mysql_query("SELECT idnoticia,foto,titulo,LEFT(descripcion,500) AS d1 from noticias order by idnoticia desc limit 1") ;
$datos1 = mysql_fetch_array($resp1) ;
?>
<table width="570" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2"><div align="center"><b><? echo $datos1[titulo] ?></b></div></td> </tr> <tr> <td width="145" valign="top"><div align="left"><img src="images_noticias/<? echo $datos1[foto] ?>" width='250' height='200' border='0'></div></td> <td width="313" valign="top"><div align="justify"><? echo $datos1[d1] ?>...
<br><br> <a href=hola.htm><? echo $datos1[titulo] ?></a> </div></td> </tr> </table>
</div>
<div id="noticia2">
<?
include("config.php") ;
$resp2 = mysql_query("SELECT idnoticia-1 as id1 from noticias order by idnoticia desc limit 1") ;
$datos2 = mysql_fetch_array($resp2) ;
?>
<?
include("config.php") ;
$resp1 = mysql_query("SELECT foto,titulo,LEFT(descripcion,500) AS d1 from noticias where idnoticia='$datos2[id1]' order by idnoticia desc limit 1") ;
$datos1 = mysql_fetch_array($resp1) ;
?>
<table width="570" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2"><div align="center"><b><? echo $datos1[titulo] ?></b></div></td> </tr> <tr> <td width="145" valign="top"><div align="left"><img src="images_noticias/<? echo $datos1[foto] ?>" width='250' height='200' border='0'></div></td> <td width="313" valign="top"><div align="justify"><? echo $datos1[d1] ?>...</div></td> </tr> </table>
</div>
<div id="noticia3">
<?
include("config.php") ;
$resp3 = mysql_query("SELECT idnoticia-2 as id1 from noticias order by idnoticia desc limit 1") ;
$datos3 = mysql_fetch_array($resp3) ;
?>
<?
include("config.php") ;
$resp5 = mysql_query("SELECT foto,titulo,LEFT(descripcion,500) AS d1 from noticias where idnoticia='$datos3[id1]' order by idnoticia desc limit 1") ;
$datos5 = mysql_fetch_array($resp5) ;
?>
<table width="570" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2"><div align="center"><b><? echo $datos5[titulo] ?></b></div></td> </tr> <tr> <td width="145" valign="top"><div align="left"><img src="images_noticias/<? echo $datos5[foto] ?>" width='250' height='200' border='0'></div></td> <td width="313" valign="top"><div align="justify"><? echo $datos5[d1] ?>...</div></td> </tr> </table>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br>
</td> </tr> </table>
Título: Re: java script con php
Publicado por: ~ Yoya ~ en 6 Octubre 2010, 19:30 pm
dejar de andar de copiando códigos, si no sabes lo que dice el código normal que tengas problema...
|