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

  • SEARCH
  • Home
  • 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 6121261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:45:51+00:00 2026-05-23T15:45:51+00:00

The structure of my html is basically: <div id=featured> <a href=><img src= alt= /></a>

  • 0

The structure of my html is basically:

<div id="featured">
  <a href=""><img src="" alt="" /></a>
  <div class="image-description">text</div>
</div>

With css:

#featured { width: 800px; height: 250px; text-align: center; position: relative; }
img { width: auto; height: 250px; }
.image-description { position: absolute; bottom: 10px; }

I have some javascript modifying my html dynamically and works fine in every other browser except IE6 and IE7. It works fine in IE8+.

In IE6 and IE7, it seems to be preventing the image from displaying. I tried debugging in IE7 with web developer tools and the image element is there, but not showing for some reason. I have not in any way css or js modified the visibility or display of the image element or container divs.

By commenting out my javascript, I narrowed it down to this:

$featured = $('#featured');
// calculate var $desc_left now to eliminate/reduce description div "jumping"
var $desc_left = ( ( $featured.width() - $featured.find('img').width() ) / 2 ) + 10;
$featured.find('.image-description').css('left', $desc_left);
$featured.find('img').load(function() {
    // calculate var $desc_left again to make sure all browsers get the correct widths, like webkit browsers
    var $desc_left = ( ( $featured.width() - $featured.find('img').width() ) / 2 ) + 10;
    $featured.find('.image-description').css('left', $desc_left);
});

The images do eventually appear if I keep reloading the page. Commenting that whole thing out makes IE7 show the image normally. Tested by deleting all browser history/cache after changing js code.

  • 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-23T15:45:51+00:00Added an answer on May 23, 2026 at 3:45 pm

    This is a stab in the dark but I’ve come across something similar in IE myself.

    It might have to do with the images not being downloaded in time for the DOM when your JavaScript executes. Reloading the page several times forces the DOM to use the cached version of the images so it then appears to work.

    Try this. The $(window).load will wait for all images to be downloaded before executing the code inside.

    $(window).load(function () {
    
        //  the following is all of your jQuery JavaScript that depends on your images being available.
    
        $featured = $('#featured');
        // calculate var $desc_left now to eliminate/reduce description div "jumping"
        var $desc_left = ( ( $featured.width() - $featured.find('img').width() ) / 2 ) + 10;
        $featured.find('.image-description').css('left', $desc_left);
        $featured.find('img').load(function() {
            // calculate var $desc_left again to make sure all browsers get the correct widths, like webkit browsers
        var $desc_left = ( ( $featured.width() - $featured.find('img').width() ) / 2 ) + 10;
        $featured.find('.image-description').css('left', $desc_left);
        });
    
    });
    

    The $(window).load can also be nested inside of your $(document).ready if needed.

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

Sidebar

Related Questions

I have a html structure like : <div onmouseover=enable_dropdown(1); onmouseout=disable_dropdown(1);> My Groups <a href=#>(view
I have the following HTML structure: $('#subgroup a').nextUntil('h3').wrapAll('<div></div>'); <script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script> <div id=subgroup> <h3>Group name
//html structure <div id='outer'> <div id='inner'> </div> </div> I am adding some data to
I have this HTML structure and want to convert it to an accordion. <div
I have this HTML structure (excerpt): <td> <select id=test1 class=pub_chooser> <option value=99>All Publications</option> <option
I have the following HTML structure <div id=test-1-yay></div> ... bunch of code ... <div
I have the following file file: <html> <head> <title></title> <script type=text/javascript src=/Prototype.js></script> <script type=text/javascript>
HTML: <div id=wrapper> <span class=stuff>Content</span> <span class=stuff>Content</span> </div> JQuery: $(document).delegate(#wrapper > *,click, function(){ //do
I'm returning HTML (which includes IMG SRC attributes) from my php scripts and I
Basically I want my HTML structure to be restructured when window gets smaller than

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.