On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Talking about this plugin. See http://www.modxcms.com/PNG-Alpha-Transparency-for-MSIE-652.html
    Has anyone tried it?
    I set it up, but it doesn’t work. In my case the PNG is a background image called in the css.
    Does it work only with the inline images? Or just I made a mistake installing it?

    Regards
    • Sorry, but the javascript can only manipulate DOM elements such as <img /> tags. It cannot dynamically replace CSS code.
      That would be really sweet though!

      -sD-
      Dr. Scotty Delicious, DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
      • Actually, it can override the included css file by specifying a new style for the given element at run-time.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • Quote from: Dr. at Nov 26, 2007, 04:31 AM

          Sorry, but the javascript can only manipulate DOM elements such as <img /> tags. It cannot dynamically replace CSS code.
          That would be really sweet though!
          Quote from: sottwell at Nov 26, 2007, 07:45 AM

          Actually, it can override the included css file by specifying a new style for the given element at run-time.
          Sorry Susan.
          Allow me to clarify my statement.
          The phrase "the javascript" in my quote above was in reference to the code within the PNG alpha plugin.
          Javascript (ECMAScript), as a scripting language can do many things that this plugin has no examples of.

          The code that this plugin is based on was originally written in 2004 and last updated in January of 2006.
          http://homepage.ntlworld.com/bobosola/

          Here are the Pros & Cons as listed by the author:
          Pros:

          • Ignored as a comment in other browsers - it’s only run by Windows IE.
          • Works with (X)HTML Strict & Transitional Doctypes
          • Does not break W3C validation
          • Lightweight and very easily deployed
          • Works with existing in-line or external CSS rules based on class or ID selectors
          • Works with old-style img align="left" or align="right" attributes
          • Runs after any existing Body Onload code
          • Works with imagemaps and input images using a special version

          Cons:
          • Doesn’t work in IE versions earlier than 5.5 - the AlphaImageLoader filter wasn’t introduced until version 5.5. There is no cure for earlier versions.
          • Requires JavaScript to be enabled - the estimations for how many people choose not to use JS vary wildly. See note [1]
          • CSS backround PNGs not supported - experimentation revealed I could traverse the Stylesheets collection and use the AlphaImageLoader trick to replace all background-image attributes containing PNGs, but then background-repeat would not work, and anchors placed over non-transparent parts of the image were not clickable :-(
          • CSS rules for the PNG images based on the img selector are lost, but this is easily rectified by adding a class selector to your img rule such that img{..} becomes img,.png{..} - then add the attribute class="png" to each of your PNGs.

          -sD-
          Dr. Scotty Delicious, DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages