Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...PNG fix (workaround) anyone?PNG fix (workaround) anyone?
Previous
 
Next
New Post
9/6/2007 11:44 AM
 

sfabian@gooddogs.com wrote

The Repository module utilizes a script file to correct PNG transparency. The script is located in /DesktopModules/Repository/js, and it's loaded in the /DesktopModules/Repository/Repository.ascx file like this...

Your fix works great for any images that are not set as a background image for any TDs in the CSS.  All of those images still have the issue of not working properly.  I have also tried the following fixes, which do not work:

http://www.twinhelix.com/css/iepngfix/

http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html

nightsoul94:

I would try your fix, but I do not have the time to school myself through that right now.  I am looking for something a little more straightforward right now (if possible).


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
9/12/2008 4:24 AM
 

Hi!

I also have the same problem, i also tried the http://www.twinhelix.com/css/iepngfix/ but no luck.

What i did was in css i placed the following code:

img { behavior:url(/iepngfix.htc); }

my iepngfix.htc is placed on the root folder (same directory with Default.aspx)

Now i added alert in the iepngfix.htc if the path is working (which is working).

The problem is that it still cant fix the background image. My guess is that the path of the blank.gif is incorrect. I have tried setting it to "/blank.gif" "blank.gif" but no luck. I also tried placing the blank.gif in root directory and skin folder. Still no luck.

 

 
New Post
9/12/2008 8:29 AM
 

legendlink wrote
 

Hi!

I also have the same problem, i also tried the http://www.twinhelix.com/css/iepngfix/ but no luck.

What i did was in css i placed the following code:

img { behavior:url(/iepngfix.htc); }

my iepngfix.htc is placed on the root folder (same directory with Default.aspx)

Now i added alert in the iepngfix.htc if the path is working (which is working).

The problem is that it still cant fix the background image. My guess is that the path of the blank.gif is incorrect. I have tried setting it to "/blank.gif" "blank.gif" but no luck. I also tried placing the blank.gif in root directory and skin folder. Still no luck.

 

Actually, use their v2 Alpha version and you can get it to work on background images.  I created a simple module to wrap their functionality and make sure it works within the DNN context (meaning path issues); information on my module is located here and a demo is located here.

As a developer you could easily reproduce what I'm doing with minimal effort -- the module is just meant for people who need a quick easy fix.


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
9/24/2008 6:53 PM
 

Just had to do this in a skin and figured I would post my results (as I found no solution here for myself).

Just add the following code to your skin's .ascx file:

<!--[if lte IE 6]>
    <script type="text/javascript">
    //JS fix for PNGs in IE 5.5 and 6
        var supersleight    = function() {
           
            var root = false;
            var applyPositioning = true;
           
            // Path to a transparent GIF image
            var shim            = '<%= SkinPath %>images/spacer.gif';
           
            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+')';
            };
       
            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;
            };
           
            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();
    </script>
<![endif]-->

 Just replace "images/spacer.gif" with the location of a 1x1 transparent gif, or create an "images" folder in the skin's path and drop a 1x1 tranxparent gif in it named "spacer.gif".

The above code was taken mostly verbatim from 24ways.org.

This works very well with 24-bit alpha blended PNG files in the document as well as for PNGs as background images. It will not work on the :hover pseudo-class though.


Best regards,
Josh Thomas
http://AfterHoursTeleconsulting.com
 

 
New Post
2/8/2010 2:11 PM
 

 Where do you get the repository module?

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...PNG fix (workaround) anyone?PNG fix (workaround) anyone?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out