Alex0007 Posted May 31, 2012 Report Share Posted May 31, 2012 Olá,Tenho um blog de humor, e na página inicial do blog exibe 10 postagens uma embaixo da outraE todas as imagens carrega ao mesmo tempo, queria saber se tem como fazer com que carrege uma imagem de cada vez de cima para baixo.Obrigado. Quote Link to comment Share on other sites More sharing options...
0 fiote Posted May 31, 2012 Report Share Posted May 31, 2012 Pra carregar uma IMAGEM de cada vez, você pode fazer assim:var urls = []; urls.push('http://hidefwallpaper.org/wp-content/gallery/4_landscape_04/landscape-national-geographic-6761345-1024-768.jpg'); // 1ª imagem urls.push('http://hidefwallpaper.org/wp-content/gallery/4_landscape_02/landscape-9643.jpg'); // 2ª imagem urls.push('http://www.deshow.net/d/file/travel/2009-06/brazil-landscape-580-2.jpg'); // 3ª imagem urls.push('http://tutorialfreakz.com/wp-content/uploads/2009/08/landscape101280x1024.jpg'); // 4ª imagem function carregaProxima() { var proximaUrl = urls.shift(); if (proximaUrl) { var img = new Image(); img.onload = function() { var div = document.createElement('div'); var tempo = new Date(); div.innerHTML = '['+ tempo.getHours()+':'+tempo.getMinutes()+':'+tempo.getSeconds()+'.'+tempo.getMilliseconds()+'] CARREGADO: '+proximaUrl; document.body.appendChild(div); }; img.src = proximaUrl; carregaProxima(); } } carregaProxima();Já pra carregar cada POST de cada vez... aí é outra história. Quote Link to comment Share on other sites More sharing options...
0 Alex0007 Posted June 6, 2012 Author Report Share Posted June 6, 2012 E como eu insiro as imagens no html usando este script? Quote Link to comment Share on other sites More sharing options...
0 fiote Posted June 8, 2012 Report Share Posted June 8, 2012 Logo depois da linha:document.body.appendChild(div); Adicione: document.body.appendChild(img); Quote Link to comment Share on other sites More sharing options...
0 JaguA Posted June 9, 2012 Report Share Posted June 9, 2012 mas c eu desativo meu JS muda nada kkkkkkkkk Quote Link to comment Share on other sites More sharing options...
0 fiote Posted June 10, 2012 Report Share Posted June 10, 2012 mas c eu desativo meu JS muda nada kkkkkkkkkq? Quote Link to comment Share on other sites More sharing options...
Question
Alex0007
Olá,
Tenho um blog de humor, e na página inicial do blog exibe 10 postagens uma embaixo da outra
E todas as imagens carrega ao mesmo tempo,
queria saber se tem como fazer com que carrege uma imagem de cada vez de cima para baixo.
Obrigado.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.