ya logre traer las img solo falta agregar estilo

This commit is contained in:
hugo cabrera diaz
2018-10-24 10:21:42 -05:00
parent 9b57288945
commit e9a90ecb5d
+16 -9
View File
@@ -7,6 +7,9 @@ let res=[
},
{
id:3,nombre:'imagen07',url:'https://k31.kn3.net/D8E7CDD3E.jpg'
},
{
id:4,nombre:'imagen08',url:'http://pre15.deviantart.net/c276/th/pre/i/2011/274/9/3/earth_and_moon_wallpaper_hd_by_loulines-d4bgsel.jpg'
}
]
for (var i = 0; i < res.length; i++)
@@ -15,21 +18,25 @@ for (var i = 0; i < res.length; i++)
console.log(res[i].id);
inserta()
}
function inserta() {
function inserta()
{
let app = document.getElementById('imgh');
let img = document.createElement('img');
let imgh = document.createElement('div');
img.src = (res[i].url);
imgh.setAttribute('class', 'carrusel');
img.setAttribute("width", "100%");
img.setAttribute("height", "300px");
app.appendChild(img);
app.appendChild(imgh);
let img = document.createElement('img');
let imgh = document.createElement('div');
img.src = (res[i].url);
img.setAttribute('class', 'carrusel');
img.setAttribute("width", "100%");
img.setAttribute("height", "300px!important");
app.appendChild(img);
// app.appendChild(imgh);
}
$(document).ready(function(){
$('.carrusel').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
infinite: true,
cssEase: 'linear',
autoplay: true,
autoplaySpeed: 2000,
dots: true,