Problem with JQuery
Problem with JQuery
Can somebody help me please?
I have a problem with a JQuery, I can not retrieve the images:
* The image files are in the img / folder and minis are 60x60 pixels
* Within the "each" cycle load for each division with "Brand " image . Use the selector $ (this) and load the tag with the html function
* Each image must be assigned a width and a height of 50 pixels
* Remember to write the path to the file "img / minis / "
* Use as index under the variable " i"
JQUERY:
- <script>
- var productos = new Array("afrodita.png",
- "arpia.jpg",
- "basilisco.jpg",
- "caballo.jpg",
- "centauro.jpg",
- "fenix.jpg",
- "gea.jpg",
- "grifo.png",
- "hidra.gif",
- "kraken.jpg",
- "medusa.png",
- "minotauro.jpg",
- "pegaso.jpg",
- "poseidon.jpg",
- "quimera.jpg",
- "satiro.jpg",
- "unicornio.jpg"
- );
- var t = $(this).attr("src");
- window.onload=function(){
- //Cargar las imágenes en las divisiones
- $(".Brand").each(function(i,elemento){
- $(this).html(<img src="/img/minis/productos[i]" width="50" height="50" alt="Brand" />);
- }
- }