SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't seem to work in Firefox either. Firebug tells me that the following is errornous:

    Code javascript:
    window.attachEvent("onload", correctPNG);


  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as mentioned, you have a piece of code that is producing errors. Standard debugging practice is to remove it and see what happens.

    I'm not 100% sure, but window.attachEvent is not cross browser compatible. I'd look at using an cross browser event handler such as this.


  3. #3
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code i've suggested you remove is still there. On Both the index.php and about.php.


  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you confirm whether it works on Firefox? Also, where exactly should this code work? I can't see any thumbnails on the index.php and whilst investigating, I saw that on about.php you had thumbs.

    About.php still has the error.


  5. #5
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I was being blind. I assumed (incorrectly) that the thumbnail viewer would involve thumbnails, but instead it uses anchors.

    I have just gone to <snip></snip> in IE7 and it works. It also shows a transition between images, which Firefox does not.

    I think because the png fix code failed, it caused any other javascript below it to fail also, ie the thumb code.

    As mentioned before, try implementing a known cross browser compatible event handler, and then assign the correctPng function to the onload event, or simply use:

    Code javascript:
    var oldLoad = window.onload;
    window.onload = function() {
    if(typeof(oldLoad) != 'undefined')
    oldLoad();
    correctPNG();
    }

    That will keep all the existing load events, but attach the correctPNG to it. Its a dirty way to do it, but for simplicity, you can't really beat it.
    Last edited by spikeZ; Jun 27, 2008 at 04:26. Reason: url removed



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
  •