Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/01/2012, 02:22
Avatar de morfasto
morfasto
 
Fecha de Ingreso: julio-2011
Ubicación: Lima
Mensajes: 291
Antigüedad: 12 años, 9 meses
Puntos: 8
Respuesta: abrir link de 2 maneras

Entiendo como dices que debe de funcionar, pero soy bastante novato en Javascript y todavia no logro hacerlo, nose como hacer para abrir el colobox con el evento onclick.

Este es mi codigo para ver si ayuda:
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <link href="estilo.css" rel="stylesheet" type="text/css" media="screen" />
  5. <script type="text/javascript" src="jquery-1.6.4.min.js"></script>
  6. <script src="jquery.colorbox-min.js"></script>
  7.     $(document).ready(function(){
  8.         $(".color__box").colorbox({iframe:true, width:912, height:895, top:20, scrolling:false});
  9.     });
  10.     function cancelarEvento(elEvento)
  11.     {
  12.         if(window.event)
  13.         window.event.returnValue= false;
  14.         else
  15.         elEvento.preventDefault();
  16.     }
  17. </head>
  18.     <a class='color__box' href='pagina.php?id=1' onclick="cancelarEvento(event); colorbox">Pagina 1<a/><br>
  19.     <a class='color__box' href='pagina.php?id=2' onclick="cancelarEvento(event); colorbox">Pagina 2<a/><br>
  20.     <a class='color__box' href='pagina.php?id=3' onclick="cancelarEvento(event); colorbox">Pagina 3<a/><br>
  21.     <a class='color__box' href='pagina.php?id=4' onclick="cancelarEvento(event); colorbox">Pagina 4<a/><br>
  22.     <a class='color__box' href='pagina.php?id=5' onclick="cancelarEvento(event); colorbox">Pagina 5<a/>
  23. </body>
  24. </html>

Espero que me puedan ayudar!

Muchas Gracias!