Need Mac Users, PNG Problems Too
Hi, I have 2 questions:
Site: http://members.shaw.ca/primexx/
1. I am using this code to ensure that in IE both foreground and background images have transparency effects, however it makes links un-clickable for some reason. How can this be fixed?
// IE 6 and Below Alpha Channel PNG Transparency Hack
// Enable Foreground Alpha Transparency
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
window.attachEvent("onload", enableAlphaImages);
}
function enableAlphaImages(){
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
if (itsAllGood) {
for (var i=0; i<document.all.length; i++){
var obj = document.all[i];
var bg = obj.currentStyle.backgroundImage;
var img = document.images[i];
if (bg && bg.match(/\.png/i) != null) {
var img = bg.substring(5,bg.length-2);
var offset = obj.style["background-position"];
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
obj.style.backgroundImage = "url('spacer.gif')";
obj.style["background-position"] = offset; // reapply
}
else if (img && img.src.match(/\.png$/i) != null) {
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='crop')"
img.src = "spacer.gif";
}
}
}
}
// Enable Background Alpha Transparency
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
window.attachEvent("onload", alphaBackgrounds);
}
function alphaBackgrounds(){
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (i=0; i<document.all.length; i++){
var bg = document.all[i].currentStyle.backgroundImage;
if (itsAllGood && bg){
if (bg.match(/\.png/i) != null){
var mypng = bg.substring(5,bg.length-2);
document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
document.all[i].style.backgroundImage = "url('spacer.gif')";
}
}
}
}
and Question 2: Would a Mac user please post a few screenshots (both top and bottom) of the site in the major Mac browsers? I can think of Safari/Konquer/Camino/Firefox right off the top of my head, but the other major browsers are welcome too...
Thank You Very Much!
02bunced posted this at 07:11 — 27th February 2006.
He has: 412 posts
Joined: May 2005
For Mac screenshots, try http://www.danvine.com/icapture/ - it is one of the many websites that take automatic screenshots and upload them to the web, free of charge. Very useful
JeevesBond posted this at 13:39 — 27th February 2006.
He has: 3,956 posts
Joined: Jun 2002
I read somewhere that you need to set the position of the element with opacity to relative in your css. So:
#elementid {
position: relative;
}
Although I could be barking up the wrong tree so to speak.
a Padded Cell our articles site!
primexx posted this at 00:05 — 28th February 2006.
They have: 2 posts
Joined: Feb 2006
it's not working...
I think it has something to do with the loader putting images on top of the page...not sure.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.