Ver Mensaje Individual
  #11 (permalink)  
Antiguo 14/11/2012, 13:27
pollin14
 
Fecha de Ingreso: marzo-2010
Ubicación: df
Mensajes: 58
Antigüedad: 14 años, 1 mes
Puntos: 5
Logica equivodada.

Tu tienes el siguiente script:
Código Javascript:
Ver original
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  2. <script src="scripts/jflow.plus.js" type="text/javascript"></script>
  3. <script type="text/javascript">
  4.     $(document).ready(function(){
  5.         $("#myController").jFlow({
  6.             controller: ".jFlowControl", // must be class, use . sign
  7.             slideWrapper : "#jFlowSlider", // must be id, use # sign
  8.             slides: "#mySlides",  // the div where all your sliding divs are nested in
  9.             selectedWrapper: "jFlowSelected",  // just pure text, no sign
  10.             width: "638px",  // this is the width for the content-slider
  11.             height: "311px",  // this is the height for the content-slider
  12.             duration: 400,  // time in miliseconds to transition one slide
  13.             prev: ".jFlowPrev", // must be class, use . sign
  14.             next: ".jFlowNext", // must be class, use . sign
  15.             auto: true 
  16.     });
  17. });
  18. </script>

La funcion $(document).ready(function() solo se ejecuta una vez cuando la pagina este completamente cargada. Ahora, $("#myController") no deberia tener nada dentro ya que su contenido sera cargado DESPUES de que la pagina sea cargada completamente. Por eso no funciona.

Lo que yo hago para asígnar eventos (o codigo javascript) a HTML cargado dinamicamente es lo siguiente.

Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.     <head>
  3.         <title></title>
  4.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5.         <script src="jquery.js" type="text/javascript"></script>
  6.         <script type="text/javascript">
  7.             $(document).ready(function(){
  8.                
  9.                 $('#boton1').click(function(){
  10.                     alert("Soy el boton 1 y mi evento fue asignado dentro de ready");
  11.                 })
  12.                
  13.                 $('#boton2').click(function(){
  14.                     alert("Soy el boton 2 y mi evento no sera asígnado porque todavia no existo");
  15.                 })
  16.                
  17.                 $.ajax({
  18.                     url:'boton2.html',
  19.                     datatype: 'html',
  20.                     success: function(html){
  21.                         $('body').append(html);
  22.                        
  23.                         //Para asignarle un evento al boton 2 descomentar
  24.                         //$('#boton2').click(function(){
  25.                             //alert("Soy el boton 2 y mi evento fue asignado despues de que la solicitud ajax fue exitosa");
  26.                         //})
  27.                     }
  28.                 })
  29.                
  30.             })
  31.         </script>
  32.         <style>
  33.             #boton1{
  34.                 height:50px;
  35.                 width:50px;
  36.                 background-color:red;
  37.             }
  38.             #boton2{
  39.                 height:50px;
  40.                 width:50px;
  41.                 background-color:blue;
  42.             }
  43.         </style>
  44.     </head>
  45.     <body>
  46.         <div id="boton1">boton 1</div>
  47.     </body>
  48. </html>


boton2.html

Código HTML:
Ver original
  1. <div id="boton2">boton 2</div>

Prueba el codigo y estoy seguro que es lo que te pasa.
__________________
Dead Nation