Caurspīdīgie PNG


Lai arī ir iespējams izvairīties no caruspīdīgu PNG izmantošanas web-lapās, tomēr sarežģītākos dizainos tas ir neizbēgami un nākās izvēlēties pareizo metodi caurspīdības iegūšanai iekš Internet Explorer. Ar parastām bildēm viss ir vienkārši – manuāli pielietojam filtrus vai arī izmantojam seno pngfix.js.

Nedaudz sarežģītāk ir ar tādām lapām, kurās visi attēli ir PNG formātā un daļa no tiem ir caurspīdīgi. Visērtāk ir pielietot gatavus skriptus, bet tie visbiežāk aizvieto arī necaurspīdīgos PNG un dēļ dažiem ierobežojumiem tiek sabojātā visa lapa. Priekš sevis es atradu iepngfix.htc kā ērtāko risinājumu, jo attēlu aizvietošanu varam piemērot tikai atsevišķiem elementiem, kur tas tiešām ir nepieciešams. Lūk arī neliels piemērs:

1
2
3
4
5
6
7
8
 <head>
 ...
 <!--[if lt IE 7]>
  <style type="text/css">
   .filter, img { behavior: url(iepngfix.htc) }
  </style>
 <![endif]-->
</head>

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!