Galería de crecer utilizando activo sentido de que los objetivos clic Thum

  • maguskrool
  • Born
  • Born
  • No Avatar
  • Registrado: May 29, 2008
  • Mensajes: 3
  • Status: Offline

Nota Septiembre 30th, 2008, 7:01 am

Hola. Im tratando de construir una galería de miniaturas que, cuando se hace clic, crecer para mostrar la imagen en tamaño completo. He creado un conjunto de datos XML de Spry e Im con un ágil: repetir que pasar por cada fila del conjunto de datos y crear la miniatura. A continuación le adjunto el efecto de crecer, pero ya que el objetivo es cada una de las miniaturas, necesito un identificador único para cada uno. Intenté usar id = "thumb_ () ds_RowID" (y ds_RowCount y ds_RowNumber), pero no funciona.

Heres mi código. XML de muestra:
Código: [ Select ]
 
<thumbnail_list>
   <thumbnail>
      <path>images/1.jpg</path>
      <caption>some text</caption>
   </thumbnail>
   ...
   <thumbnail>
      <path>images/n.jpg</path>
      <caption>some text</caption>
   </thumbnail>
</thumbnail_list>
 
  1.  
  2. <thumbnail_list>
  3.    <thumbnail>
  4.       <path>images/1.jpg</path>
  5.       <caption>some text</caption>
  6.    </thumbnail>
  7.    ...
  8.    <thumbnail>
  9.       <path>images/n.jpg</path>
  10.       <caption>some text</caption>
  11.    </thumbnail>
  12. </thumbnail_list>
  13.  


En la página HTML Luego de crear el conjunto de datos y la galería.
Código: [ Select ]
 
dataset:
var dsThumbs = new Spry.Data.NestedXMLDataSet(dsThumbs, "thumbnail_list/thumbail");
 
gallery:
<table>
   <tr spry:region="dsThumbnails" spry:repeat="dsThumbnails">
      <td><img id="wp_{ds_RowID}" src="{path}" onclick="grow_effect_{ds_RowID}.start(); return false;"/></td>
   </tr>
</table>
 
  1.  
  2. dataset:
  3. var dsThumbs = new Spry.Data.NestedXMLDataSet(dsThumbs, "thumbnail_list/thumbail");
  4.  
  5. gallery:
  6. <table>
  7.    <tr spry:region="dsThumbnails" spry:repeat="dsThumbnails">
  8.       <td><img id="wp_{ds_RowID}" src="{path}" onclick="grow_effect_{ds_RowID}.start(); return false;"/></td>
  9.    </tr>
  10. </table>
  11.  


Entonces tengo que crear la variable que representa el efecto de crecer. Traté de 2 diferentes enfoques:
Código: [ Select ]
 
1. Inside the spry:region, in the spry:repeat loop:
<table>
   <tr spry:region="dsThumbnails" spry:repeat="dsThumbnails">
      <td><img id="wp_{ds_RowID}" src="{path}" onclick="grow_effect_{ds_RowID}.start(); return false;"/></td>
      <script type="text/javascript">
         var grow_effect_{ds_RowID} = new Spry.Effect.Grow("wp_{ds_RowID}", {duration:1000, from:"100%", to:"20%", toggle: true});
      </script>
   </tr>
</table>
 
2. And at the end of the code, creating each variable manually:
<script type="text/javascript">
   var grow_effect_0 = new Spry.Effect.Grow("wp_0", {duration:1000, from:"100%", to:"20%", toggle: true});
   ...
   var grow_effect_n = new Spry.Effect.Grow("wp_n", {duration:1000, from:"100%", to:"20%", toggle: true});
</script>
 
  1.  
  2. 1. Inside the spry:region, in the spry:repeat loop:
  3. <table>
  4.    <tr spry:region="dsThumbnails" spry:repeat="dsThumbnails">
  5.       <td><img id="wp_{ds_RowID}" src="{path}" onclick="grow_effect_{ds_RowID}.start(); return false;"/></td>
  6.       <script type="text/javascript">
  7.          var grow_effect_{ds_RowID} = new Spry.Effect.Grow("wp_{ds_RowID}", {duration:1000, from:"100%", to:"20%", toggle: true});
  8.       </script>
  9.    </tr>
  10. </table>
  11.  
  12. 2. And at the end of the code, creating each variable manually:
  13. <script type="text/javascript">
  14.    var grow_effect_0 = new Spry.Effect.Grow("wp_0", {duration:1000, from:"100%", to:"20%", toggle: true});
  15.    ...
  16.    var grow_effect_n = new Spry.Effect.Grow("wp_n", {duration:1000, from:"100%", to:"20%", toggle: true});
  17. </script>
  18.  


Ninguno de estos trabajado, y creo que entender por qué en el 1er enfoque. El ds_RowID no es válido fuera de la Spry: región, pero tal vez theres una manera de evitar esto?

¿Puede alguien darme algún tipo de asesoramiento sobre cómo podría hacer este trabajo? Gracias.
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Septiembre 30th, 2008, 7:01 am

Publicar Información

  • Total de mensajes en este tema: 1 mensaje
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 141 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC