elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web
| | |-+  PHP (Moderador: #!drvy)
| | | |-+  java script con php
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: java script con php  (Leído 1,725 veces)
cyberherles

Desconectado Desconectado

Mensajes: 22


Ver Perfil
java script con php
« 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...

Código:
<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>&nbsp;&nbsp;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>
          


En línea

~ Yoya ~
Wiki

Desconectado Desconectado

Mensajes: 1.125



Ver Perfil
Re: java script con php
« Respuesta #1 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...


En línea

Mi madre me dijo que estoy destinado a ser pobre toda la vida.
Engineering is the art of balancing the benefits and drawbacks of any approach.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
drama con windows.open[blogger y java script]
Desarrollo Web
flacc 2 3,139 Último mensaje 5 Enero 2011, 08:00 am
por flacc
Logica en programacion Java Script
Programación General
ivesorm 1 3,813 Último mensaje 16 Febrero 2011, 14:35 pm
por Ferno
Codigo Java Script generado por php no funciona !!!!!!
Desarrollo Web
Lupin 5 4,323 Último mensaje 15 Abril 2011, 02:30 am
por Lupin
Como funciona lo de java script?
Desarrollo Web
Edu 7 4,741 Último mensaje 17 Mayo 2011, 03:24 am
por Edu
(Cerrado) funciones java script no me funcionan
Desarrollo Web
Zeroql 5 4,594 Último mensaje 29 Julio 2011, 14:05 pm
por Zeroql
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines