Randomly load, from array, image and text to swappable placeholders?

I will be really good with Javascript; but I currently am not. :icon_confused:

Trying to dynamically load an image into one placeholder with cooresponding text. The trick is targeting the horizontal or vertical placeholders.

- two divs, 350 x 500, one horizontal one vertical
- Depending on the image, whether it's vertical or horizontal, load to appropriate div
- Then put coorisponding text in the available div

Any questions or comments are much appreciated!

How do we edit our posts?
Anyway, I'm using:

<script type="text/javascript">
function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
  document.getElementById(pictureName).src = imageFile;
  document.getElementById(titleCaption).src = captionText;
}

</script>

</head>

<body onload="LoadGallery('content_img', 'img/image1.jpg', 'content_text', 'img/image2.jpg')">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.