Foros del Web » Programando para Internet » Jquery »

Enviar variable a ventana MODAL

Estas en el tema de Enviar variable a ventana MODAL en el foro de Jquery en Foros del Web. link: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código PHP: Ver original echo "<a href='' class='osx'><img " . $res [ 'src' ] . " " . $res [ 'Titulo' ] ...
  #1 (permalink)  
Antiguo 21/03/2013, 17:18
 
Fecha de Ingreso: junio-2012
Mensajes: 8
Antigüedad: 11 años, 10 meses
Puntos: 0
Pregunta Enviar variable a ventana MODAL

link:
Código PHP:
Ver original
  1. echo "<a href='' class='osx'><img ".$res['src']." ".$res['Titulo']. "alt='' /></a>";


Modal
Código Javascript:
Ver original
  1. jQuery(function ($) {
  2.     var OSX = {
  3.         container: null,
  4.         init: function () {
  5.             $("input.osx, a.osx").click(function (e) {
  6.                 e.preventDefault();
  7.  
  8.                 $("#osx-modal-content").modal({
  9.                     overlayId: 'osx-overlay',
  10.                     containerId: 'osx-container',
  11.                     closeHTML: null,
  12.                     minHeight: 80,
  13.                     opacity: 65,
  14.                     position: ['0',],
  15.                     overlayClose: true,
  16.                     onOpen: OSX.open,
  17.                     onClose: OSX.close
  18.                 });
  19.             });
  20.         },
  21.        
  22.         open: function (d) {
  23.             var self = this;
  24.             self.container = d.container[0];
  25.             d.overlay.fadeIn('slow', function () {
  26.                 $("#osx-modal-content", self.container).show();
  27.                 var title = $("#osx-modal-title", self.container);
  28.                 title.show();
  29.                 d.container.slideDown('slow', function () {
  30.                     setTimeout(function () {
  31.                         var h = $("#osx-modal-data", self.container).height()
  32.                             + title.height()
  33.                             + 20; // padding
  34.                         d.container.animate(
  35.                             {height: h},
  36.                             200,
  37.                             function () {
  38.                                 $("div.close", self.container).show();
  39.                                 $("#osx-modal-data", self.container).show();
  40.                             }
  41.                         );
  42.                     }, 300);
  43.                 });
  44.             })
  45.         },
  46.         close: function (d) {
  47.             var self = this; // this = SimpleModal object
  48.             d.container.animate(
  49.                 {top:"-" + (d.container.height() + 20)},
  50.                 500,
  51.                 function () {
  52.                     self.close(); // or $.modal.close();
  53.                 }
  54.             );
  55.         }
  56.     };
  57.  
  58.     OSX.init();
  59.  
  60. });


Lo que mostraria el modal:
Código HTML:
Ver original
  1. <!-- modal content -->
  2.         <div id="osx-modal-content">
  3.             <div id="osx-modal-title"></div>
  4.             <div class="close"><a href="#" class="close">x</a></div>
  5.             <div id="osx-modal-data">
  6.  
  7.            
  8.                 <p><button class="close">Close</button></p>
  9.             </div>
  10.         </div>


mi problema es .... yo cargo varias imagenes en un slide.. quiero enviar un ID o el nombre de la imagen o algun tipo de variable q identifique q imgen estyo abriendo. Para asi en el modal poder usar esa variable y buscar en la base de datos todo lo referido a esa imagen.

dese ya muchas gracais

Etiquetas: html, input, javascript, modal, variable, ventana
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:32.