SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    display image in a dhtml popup in IE6

    I'm trying to create a popup using DHTML (absolutely positioned DIV). The problem is when I use innerHTML to put the image inside my popup, in IE 6 the image usually doesn't show. Sometimes it does after trying the same popup multiple times, but most often the popup shows up blank, and I have to right-click the image and then select "Show Image" to actually display the image. This only happens in IE6, it works fine in IE7 or any other browser. Do you guys know of any trick that I'm missing here? You can see what I mean here: www.ytimes.info/test-popup.html.

    Thanks,

    Istvan Siposs

  2. #2
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As a quick 'n' dirty to get IE 6 working, you might try a refresh of the image's src in IE conditional comments:

    <!--[if lte IE 6]>
    //src refresh code here
    <![endif]-->

  3. #3
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I actually have some conditionals in place, but the actual javascript code doesn't seem to work. How could I force a refresh on the image? This is what I was trying:

    Code:
    	var pop = document.getElementById("ytpopup");
    	var guts = document.getElementById("ytpopupGuts");
    	pop.style.display = "block";
    	guts.innerHTML = "<img id=popImg border=0 src=" + src + ">";
    	guts.style.backgroundImage = "url(" + src + ")";
    	var img = document.getElementById("popImg");
    	if (popImg)
    	{
    	    popImg.style.visibility = "visible";
    	}


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •