Montana-Media-Arts / 441-WebTech-Spring2020-Examples

17 stars 0 forks source link

Displaying images in an array #8

Open MistyDaniels opened 4 years ago

MistyDaniels commented 4 years ago

Pardon my lack of coordination and communication skills tonight but boy howdy am I frustrated!

I've been working for two nights now trying to figure out how to display my images using an array and I'm coming up with nothing. I feel like I'm over thinking it and I'm missing something really small and stupid. right now I'm linking them and they're only coming up as text, but when I try to add a src it stops working all together. I've started back up from scratch and I'll show you what I've worked through so far. I'm just curious to see what methods other people are using?

function printArray()
{
  var line1 = new Array("images/white0.png", "images/white1.png", "images/white2.png", "images/white3.png", "images/white4.png");
  var allGrid = "";
  for(var i = 0; i < line1.length; i++)
  {
      allGrid += line1[i] + "<br>";
  }
  document.getElementById("firstGrid").innerHTML = allGrid;
}
michaelcassens commented 4 years ago

Hi Misty,

Don't forget to put your image paths into img tags.

Hope this helps!

Michael

On Mon, Feb 17, 2020, 10:59 PM MistyDaniels notifications@github.com wrote:

Pardon my lack of coordination and communication skills tonight but boy howdy am I frustrated!

I've been working for two nights now trying to figure out how to display my images using an array and I'm coming up with nothing. I feel like I'm over thinking it and I'm missing something really small and stupid. right now I'm linking them and they're only coming up as text, but when I try to add a src it stops working all together. I've started back up from scratch and I'll show you what I've worked through so far. I'm just curious to see what methods other people are using?

function printArray() { var line1 = new Array("images/white0.png", "images/white1.png", "images/white2.png", "images/white3.png", "images/white4.png"); var allGrid = ""; for(var i = 0; i < line1.length; i++) { allGrid += line1[i] + "
"; } document.getElementById("firstGrid").innerHTML = allGrid; }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Montana-Media-Arts/441-WebTech-Spring2020-Examples/issues/8?email_source=notifications&email_token=AAB7ORHTDLPO7J77HF32DRLRDN2LZA5CNFSM4KW5VY62YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IOGUXEA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB7ORD5VHB64V3O6WPRCLDRDN2LZANCNFSM4KW5VY6Q .