Page 1 of 1
pngbehavior.htc not working?
Posted: Mon 28. Aug 2006, 11:45
by update
hi,
has anybody got the pngbehavior.htc working already?
SOme months ago I successfully finished a very complicated site (png-reated) but with this 1.2.8 default install I'm really lost
thank you
greetings
claus
Posted: Mon 28. Aug 2006, 11:51
by pico
Hi
you have these Setting in your conf.inc.php ?
Code: Select all
$phpwcms['IE_htc_hover'] = 1;
$phpwcms['IE_htc_png'] = 1;
and the *.htc Files are also present
Look into HTML-Source that the this is in with correct Pathes
Code: Select all
<!--[if lt IE 7]>
<style type="text/css">
body { behavior: url("phpwcms_template/inc_css/specific/csshover2.htc"); }
img { behavior: url("phpwcms_template/inc_css/specific/pngbehavior.htc"); }
</style>
<![endif]-->
</head>
maybe a Link to your Site to see what happens (or not)
and the blank.gif must also present in ../specific Folder !
Posted: Mon 28. Aug 2006, 12:15
by update
hi pico,
thank you!!! That did it!
I indeed was missing the entries in the conf file! They don't seem to be there by default.
So I added it and the ie specific code entry showed up at last

and the normal img tag is working now
Now I'm playing around with the htc file again - I have one which can be applied to background pics in classes and containers too (even covered with pngs

multimultilayered transparent pngs)
When I'm finished with this I will post it here (howto...

)
Thanks again
claus
Posted: Mon 28. Aug 2006, 13:53
by Oliver Georgi
if you have such custom HTC file check phpwcms_template/inc_css/specific/ie_only.css
There you can put in your custom behavior code.
Oliver
Posted: Mon 28. Aug 2006, 15:12
by update
Thank you oliver.
I've already seen it
My custom pngvehavior.htc has been written by the same author, but seems to be newer? I will check...
greetings
claus
Posted: Mon 28. Aug 2006, 15:24
by Oliver Georgi
Give a hint if it's relly newer and also working more global images.
Oliver
Posted: Mon 28. Aug 2006, 18:37
by update
OK I paste it here. The copyright is from 2002 and the version tells 1.0a, but there is a newer changelog and I liked the idea of the -trans possibility - anyway, check yourself (for me it's all böhmische dörfer yet)
Code: Select all
<public:component>
<public:attach event="onpropertychange" onevent="propertyChanged()" />
<public:attach event="onbeforeprint" for="window" onevent="beforePrint()" />
<public:attach event="onafterprint" for="window" onevent="afterPrint()" />
<script>
/*
* PNG Behavior
*
* This script was created by Erik Arvidsson (erik(at)eae.net)
* for WebFX (http://webfx.eae.net)
* Copyright 2002
*
* For usage see license at http://webfx.eae.net/license.html
*
* Version: 1.01a
* Created: 2001-??-?? First working version
* Updated: 2002-03-28 Fixed issue when starting with a non png image and
* switching between non png images
* 2003-01-06 Fixed RegExp to correctly work with IE 5.0x
* 2004-04-25 Fixed PNG image printing, eliminated need for external
* GIF file, fixed intermittent uninitialised variable
* error [by AG, <http://www.scss.com.au/family/andrew/> ]
* 2004-09-30 Reverted inline javascript image to transparent GIF. The
* new XP SP2 'security' measures prevented the JS image
* from working. [by AG]
* 2004-10-22 Rewrote fixImage() to try and work around some reported
* problems with PNGs vanishing! [by AG]
* 2004-12-12 Fixed problem with PNGs not being restored after
* printing. I have no idea how I missed this one! [by AG]
* 2005-03-26 Fixed supported RE mis-identifying IE 5.0/Win98 as
* 'supported'.
*
*/
var IS_PNG = /\-trans\.png$/i; /* <-- NOTE: remove the "\-trans" to process *all* PNGs */
var supported = /MSIE (5\.5|[6789])/.test(navigator.userAgent) && navigator.platform == 'Win32';
var realSrc;
var blankSrc = '../website/support/blank.gif';
if (supported) fixImage();
function propertyChanged() {
if (supported && event.propertyName == 'src') {
var i = element.src.lastIndexOf(blankSrc);
if (i == -1 || i != element.src.length - blankSrc.length) {
fixImage();
}
}
}
function fixImage() {
if (realSrc && element.src == realSrc) {
// this is an attempt to set the image to itself!
// pointless - leave the filter as-is, restore the blank image
element.src = blankSrc;
} else {
// set the image to something different
if (IS_PNG.test(element.src)) {
// fixable PNG
realSrc = element.src;
element.src = blankSrc;
element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + realSrc + "',sizingMethod='scale')";
} else {
// ordinary image - make sure the fix is removed
if (realSrc) {
realSrc = null;
element.runtimeStyle.filter = '';
}
}
}
}
function beforePrint() {
if (realSrc) {
supported = false;
element.src = realSrc;
element.runtimeStyle.filter = '';
supported = true;
}
}
function afterPrint() {
if (realSrc) {
var rs = realSrc;
realSrc = null;
element.src = rs;
}
}
</script>
</public:component>
Not working...everything is set correctly
Posted: Mon 17. Sep 2007, 19:51
by anthony.abraira
The PNG transparency is not working on my IE. It just loads the image with a gray background and then it vanishes all together.

I checked the conf file and the PNG support for IE is turned on. I went ahead and checked the specific folder in the inc_css and the htc along with the blank.gif is there. The site where this is occuring is at:
http://robertstcroix.com/index.php?about
http://robertstcroix.com/index.php?gallery
The gallery one has a PNG image inside a floating div. Since it vanishes inside IE, the entire formatting is all screwed up. I have the feeling if I can get these images to appear, they will fix the layout problems organically.
Note: The image in the about and gallery sections were added with hand written html not using the image CPs of phpWCMS...can somebody tell me where this went awry?:?:
Peace
Never mind
Posted: Mon 17. Sep 2007, 20:02
by anthony.abraira
Figured it out. You need to set the width and height, otherwise its not going to work...just a note