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 1065201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:46:22+00:00 2026-05-16T19:46:22+00:00

I use the AlphaImageLoader fix called supersleight with the following code: var supersleight =

  • 0

I use the AlphaImageLoader fix called supersleight with the following code:

   var supersleight = function() {

 var root = false;
 var applyPositioning = true;

 // Path to a transparent GIF image
 var shim   = 'images/empty.gif';

 // RegExp to match above GIF image name
 //var shim_pattern = /x\.gif$/i;



 var fnLoadPngs = function() { 
  if (root) {
   root = document.getElementById(root);
  }else{
   root = document;
  }
  for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
   // background pngs
   if (obj.currentStyle.backgroundImage.match(/\_.png/i) !== null) {
    bg_fnFixPng(obj);
   }
   // image elements
   if (obj.tagName=='IMG' && obj.src.match(/\_.png$/i) !== null){
    el_fnFixPng(obj);
   }
   // apply position to 'active' elements
   if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){
    obj.style.position = 'relative';
   }
  }
 };

 var bg_fnFixPng = function(obj) {
  var mode = 'scale';
  var bg = obj.currentStyle.backgroundImage;
  var src = bg.substring(5,bg.length-2);
  if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
   mode = 'crop';
  }
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
  obj.style.backgroundImage = 'url('+shim+')';
  obj.style.visibility= 'visible';
 };

 var el_fnFixPng = function(img) {
  var src = img.src;
  img.style.width = img.width + "px";
  img.style.height = img.height + "px";
  img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
  img.src = shim;
  img.style.visibility= 'visible';
 };

 var addLoadEvent = function(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
   window.onload = func;
  } else {
   window.onload = function() {
    if (oldonload) {
     oldonload();
    }
    func();
   };
  }
 };

 return {
  init: function() { 
   addLoadEvent(fnLoadPngs);
  },

  limitTo: function(el) {
   root = el;
  },

  run: function() {
   fnLoadPngs();
  }
     };
    }();

    // limit to part of the page ... pass an ID to limitTo:
    // supersleight.limitTo('header');
    supersleight.init();
    //Från början är opacity'n 100 eftersom jag inte vet om Javascript är påsatt eller inte och därmed inte vet om PNG'arna kommer att
    //bli genomskinliga eller ej. Är Javascript på så gör jag också bakgrunden genomskinlig så att PNG'arnas genomskinlighet inte blir i onödan
    //If-satsen eftersom transparency ej existerar på första-sidan och därigenom ger fel där

    if(document.getElementById('transparency') != null){
     document.getElementById('transparency').style.filter= "alpha(opacity=60)";
     document.getElementById('transparency').style.background = "#cccccc";
     }

I call it via a SCRIPT defer tag in the beginning of the HTML file. When I upload the script and page to the server, it works great but when I try it locally, no image is shown at all. Basically, the script sets the background as the former PNG image using the AlphaImageLoader and then sets an empty pixel as IMG src instead.

If I comment out:

//img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
//img.src = shim;

the image appears in normal state, that is as a PNG with transparency removed. Somehow, the filter doesn’t set the background properly when it’s done locally and leaves it empty. When trying this at Browsershots and IE Netrenderer (ipinfo.info) I get the same result at Netrenderer even though Browsershots, Microsoft Expression Web Superpreview 3, testing with multipleIEs and IETester shows things the way they should…

Anyone got an idea?


Turns out it was because I accessed it via file:// and all of it was lying in a folder with lots of spaces and strange characters in its name.. .not that I thought it would matter but apparently, for this effect to work in my case, I can’t have it in a folder which doesn’t follow a simple syntax without spaces and stuff… maybe it’s more of a general Explorer issue than specifically AlphaImageLoader… anyone who wants to enlighten me a bit more in this matter is welcome! 🙂


One more update… I can access it both via web, local server (localhost) and directly through file (file:// or C://) without problem. The problem occurs when the following happens:

I had a folder with the following name:

Sirocco v. 1.2 (uploaded 100908)
PNGfix+bakgrundsfärger_IE5.5-6

When using other folder names the problem never occurred so I tried to narrow it down… seems like the

)

symbol is the one that causes the problem.. with it, the AlphaImageLoader doesn’t fill the background the way it’s supposed to but without it, the background fills alright… anyone got a clue as to why?

  • 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-16T19:46:23+00:00Added an answer on May 16, 2026 at 7:46 pm

    SOLUTION: I feel stupid, this has got to do with the parameters received by the filter effect.

    The use of the filter looks like this:

    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader('source','sizingMethod')
    

    Of course when I go on and pound the follwing for source:

    Sirocco v. 1.2 (uploaded 100908)
    PNGfix+bakgrundsfärger_IE5.5-6

    …the filter won’t know where to close the paranthesis and closes it too early, hence the image path being incorrect and the sizingmethod not even included. Of course this could have been foreseen by the programmer but I don’t blame him.. cmon what kind of folder names am I using here??? Of course. I wouldn’t use them in a real situation.. it’s just for local storing of a website so I can keep track of which version.

    SOLVED! Thank you all of you!

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

Sidebar

Related Questions

I use the following to visualize the range of means when averaging n coin
I use code belows for dump a specific schema, before dumped it has 4
I am using AlphaImageLoader to display my transparent PNG in IE6. The HTML is,
Use these 2 persistent CFCs for example: // Cat.cfc component persistent=true { property name=id
I use a C++ DLL in my app. type Tcl_bla = function(filename: PChar): Integer;
i use this code : request.session.set_test_cookie() the all code is : def main(request, template_name='index.html'):
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
Use case: A does something on his box and gots stuck. He asks B
Use case: 3rd party application wants to programatically monitor a text file being generated
We use a data acquisition card to take readings from a device that increases

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.