Results 1 to 10 of 10

Thread: Internet Explorer for windows not showing img src changes

  1. #1
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Internet Explorer for windows not showing img src changes

    If you're using Internet Explorer on Windows, you can see what I'm talking about by going to one of my portfolio pages, and then click around on the thumbnails:

    www.MeredithABaxter.com/Portfolio/Design/

    The images don't always show up. Internet Explorer for Windows is the only browser that exhibits this inconsistent behavior. If you right click on the image area you can select "Show Picture" and it will show up. I don't understand why the images are disappearing.

    When you click on a thumbnail I run the following code:

    Code:
    <a href="Javascript:;" 
    onMouseDown="curthumb=14;
    var popx=getsize_x()*9/10;
    var popy=getsize_y()*9/10;
    var p1=popup('steadman.htm','mepop','Click here to view a larger image.',popx,popy,'no','yes');
    var t1='Self-Portrait in the style of Ralph Steadman<br>ink<br>2004<br><br>'+p1;
    document.getElementById('description').innerHTML=t1;
    document.getElementById('counter').innerHTML=+curthumb+' / '+numthumb;
    document.getElementById('view').src='Images/Med/Msteadman.gif';
    document.getElementById('view').style.visibility='visible';
    "><img class="thumb" src="Images/Small/Ssteadman.gif" width="50" height="50" alt="thumbnail"></a>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It only seems to happen after I've chosen to allow popups and view one. So, I think it may have something to do with the:

    Code:
    popup('steadman.htm','mepop','Click here to view a larger image.',popx,popy,'no','yes');
    function. If written properly, the popup shouldn't require permission. This may or may not have anything to do with your problem. I'm not sure if I've followed your quoting scheme properly but, if so, you may have better luck with this version:

    Code:
    //POPUP
    function popup(url,name,txt,width,height, menu, resize){
    var murl='\"'+url+'\"';
    var mname='\"'+name+'\"';
    var mdim='\"toolbar='+menu+', scrollbars='+menu+', location='+menu+',  status='+menu+', menubar='+menu+', resizable='+resize+', height='+height+',width='+width+'\"';
    var p="<a href=\'"+url+"\' onclick=\'"+name+"=window.open(this.href,"+mname+","+mdim+"); "+name+".focus(); "+name+".resizeTo("+width+","+height+");return false;\'>"+txt+"</a>";
    return p;
    }
    Last edited by jscheuer1; 04-16-2006 at 07:50 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Popups interfering?

    Here is the Popup function I'm using:

    Code:
    function popup(url,name,txt,width,height, menu, resize){
    	var murl='\"'+url+'\"';
    	var mname='\"'+name+'\"';
    	var mdim='\"toolbar='+menu+', scrollbars='+resize+', location='+menu+',  status='+menu+', menubar='+menu+', resizable='+resize+', height='+height+',width='+width+'\"';
    	var p="<a href=\'javascript:;\' onMouseDown=\'var "+name+"=window.open("+murl+","+mname+","+mdim+"); "+name+".focus(); "+name+".resizeTo("+width+","+height+");\'>"+txt+"</a>";
    	return p;
    }
    Pretty much the same as what you've suggested?

    It seems that on some machines, it acts up more when I open up the popup first, other times, it behaves this way even before you open a popup.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Have you tried it with my pop up code? Anyways, after I posted that, I tried mine out. It works and does not cause IE to prompt one to allow pop ups. The two major differences are that in my version the href is the same as the pop up url, in fact the href is used as the window.open() method's url and that the pop up occurs onclick instead of onmousedown.

    I could not get your page to misbehave in IE without first having used at least one 'view larger image' link (the links generated by this very function). After that, it misbehaved a lot, without ever having to use a 'view larger image' link again. My thinking is that, by preventing the partial reload and repositioning of the content that answering 'allow pop ups temporarily' to the allow 'pop ups?' prompt causes, one might avoid the other problem altogether.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmmm, I put up your code on my site and tested it out again (cleared the cache etc etc) and I'm still seeing the problem on my windows IE browser. It even misbehaves before I click on the link. After I click on the link, it is much worse, however.

    ????

    thanks for all of your help, by the way, i'm kind of new to JS and this kind of stuff drives me crazy.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I still cannot get it to behave badly without first using at least one view larger image. It is a bit of a compromise but, try this demo and see what happens:

    http://home.comcast.net/~jscheuer1/side/meredith_h.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here's another demo, works well here:

    http://home.comcast.net/~jscheuer1/s...redith_h_2.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This one works much better. Can you explain why you changed what you did?

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You had many:

    HTML Code:
    href="javascript:;"
    This is non-standard so, became suspect when things weren't working. Another non-standard approach was using onmousedown instead of onclick. The main reason to do that is if onclick doesn't work. Onclick requires 'return false;' if used with an anchor link that you don't want firing. In this case, javascript:void(0); should have taken care of that but, using return false just makes one less thing that the browser needs to contend with and it was obviously having problems with the way things were.

    The popup function that you have is overly complex for what you are using it for, I suspect that you got it as a sort of 'Swiss Army Knife' approach. I just cut it down more to what was needed and made it less likely to cause a browser to block the popup. I also added some code, using the existing functions for getting the window dimensions, to make it more likely that the popup would be entirely within the users viewable screen area.

    Incidentally, the:

    HTML Code:
    <base href="http://www.meredithabaxter.com/Portfolio/Design/" />
    Is only required for an offsite demo. You can remove it for a page on your site but, leaving it shouldn't hurt anything.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Awesome. Thanks again for all your help!

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
  •