Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5998079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:21:17+00:00 2026-05-23T00:21:17+00:00

This question regards my personal photography website. I use the following javascript to generate

  • 0

This question regards my personal photography website. I use the following javascript to generate random image sequences each time the page is loaded or refreshed:

    <script type="text/javascript"> $(function () {
  var ar = [];
  function returnRandomUnique() {
    if ( !ar.length) {
      for (var i = 16; i > 0; i--)
        ar[ar.length] = i;
    }
      return '<img alt="photograph" class="picture" src="images/work_images/image_' + ar.splice(Math.floor(Math.random() * ar.length) ,1) + '.jpg"  height="550" width=""/>';
   }
  // test
  var str = [];
 for (var j = 0; j <16; j++){
    str[str.length] = returnRandomUnique();
  }
 $("#mainwork").append(str.join(''));
 });
  </script>

My html and css both validate (css has border radius warnings for three buttons) and the site looks good on everything except any version of IE. The problem is that the width of each image varies and cannot be specified (heights are all consistent at 550px –the site scrolls left to right.)

IE displays each image as a line, 550px high by 1px wide. I’d like to find a value that will allow the images to display properly or force IE to use a different html page that will have a fixed layout (remove the random image generator javascript) where I can add the values as appropriate. I don’t know how to force one browser to use a different html file. Any help would be greatly appreciated. I’m not really familiar with javascript, but found this in a library and modified it as best as I could to fit my needs.

Thanks,

Matt

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:21:17+00:00Added an answer on May 23, 2026 at 12:21 am

    You should remove width="". If I remember correctly, that screws up IE.


    Testing it here: http://jsfiddle.net/4pE7E/

    In IE9/8/7, it does indeed cause the image to be 1px wide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In regards to my this question , I got this following answer to add
I'm pretty sure this is a simple question in regards to formatting but here's
This question is about removing sequences from an array, not duplicates in the strict
This question is in regards to this blog entry. https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ All the way at
Disclaimer, I not do anything in particular with regards this question, just curious. Is
I was looking at this question Here in regards to this library. However it
First of all, this question is in regards to PHP and MySQL I have
I suppose this question is language-agnostic, tho I'm asking it in regards to building
I understand this question can be general but, specifically with regards to ASP.NET MVC,
This question regards how one can effectively create and persist event domain objects on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.