This is the blog to share your views and ideas and opinions of diffrent type of people, on our politics, media movies on each and every thing....

don't forget to comment.....!

image as png24 IN IE6

image transparent to avoid browser compatability
in some cases , we need to slice the image as png24, by hiding all background images in the psd , and slice the image according to our requirement…then save it it as a by selecting alt+ctrl+shift+s
then save our images…
we follow the above steps in case of our imagea and the background image not matching…
inorder to make it as a transparent image we use png24 image,
still we get browser compatability, in the ie6……..
for that we use the javascript code and one image
the following is the javascript code…
—————————————————
var clear=”images/clear.gif” //path to clear.gif

pngfix=function(){var els=document.getElementsByTagName(’*');var ip=/\.png/i;var i=els.length;while(i– >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter=
“progid:DXImageTransform.Microsoft.AlphaImageLoader
(src=’”+el.src+”‘,sizingMethod=’crop’)”;el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split(’”‘);var rep=(el.currentStyle.backgroundRepeat==’no-repeat’)?’crop’:’scale’;es.filter=”progid:DXImageTransform.Microsoft.AlphaImageLoader
(src=’”+path[1]+”‘,sizingMethod=’”+rep+”‘)”;es.height=el.clientHeight+’px’;es.backgroundImage=’none’;var elkids=el.getElementsByTagName(’*');if (elkids){var j=elkids.length;if(el.currentStyle.position!=”absolute”)es.position=’static’;while (j– >0)if(!elkids[j].style.position)elkids[j].style.position=”relative”;}}}}}
window.attachEvent(’onload’,pngfix);

———————————————
save the above javascript as 3.js and place it in the js folder

———————————————-
and the image here




clear

——————————–
save the above image and place it in the images folder

—————-
and include the javascript file in to your html pages……as
script language=javascript src=js/3.js

and include the above statement in each page of ur html project…

0 comments:

Post a Comment

 
Bookmark and Share blogarama.com