ThePNGFixjQueryplug-inwasdevelopedtocreateaquick-and-easyfixforthePNGtransparencyissueinInternetExplorer6.It'spartiallybasedonAngusTurnbullsTwinHelixfix,butaimstoremoveun-neededHTTPrequests,demandedbyan.htcCSSbehaviour()basedsolution.
Pleasenote,repeatablebackgroundsarestillnotfullysupportedatthistime.TheIEAlphaImagefilterisrestrictedtoscalingbackgrounds,ratherthanrepeating(ortiling).
ForfullAPIinformationvisitCampbellsDigitalSoup
ExamplesToapplythefixtoallimageswithinthepage:
jQuery(function($){ $("img").pngfix();});
AmoreefficientapproachwouldbetoapplyittoallimageelementsthatreferencePNGs,ordirectlyviaIDs.
jQuery(function($){ $("img[@src$=png],#image-one,#image-two").pngfix();});
Options
Thereiscurrentlyonlyoneoptionforthisplug-in:
repeatMethodChoosebetweenthethreeoptionsforbackgroundscaling(inlinewiththeMSDNguidancefortheAlphaLoaderfilter:Crop:renderstheimageatinitialsize.Scale:stretchestheimagetothesizeofappliedelement.ForfullAPIinformationvisitCampbellsDigitalSoup
评论