Sunday, April 30, 2006

PNG-24 on Windows IE

JavaScript to make IE on Windows allow alpha transparency in PNG images (24bit PNG with 8bit of transparency).

<!--[if gte IE 5.5000]>
<script language="JavaScript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
   {
   for(var i=0; i<document.images.length; i++)
      {
   var img = document.images[i]
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
   var imgID = (img.id) ? "id='" + img.id + "' " : ""
   var imgClass = (img.className) ? "class='" + img.className + "' " : ""
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
   var imgStyle = "display:inline-block;" + img.style.cssText
   if (img.align == "left") imgStyle = "float:left;" + imgStyle
   if (img.align == "right") imgStyle = "float:right;" + imgStyle
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
   img.outerHTML = strNewHTML
   i = i-1
      }
      }
   }
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->

Tuesday, April 25, 2006

Google Maps Mobile Beta

Google Map on Nokia 6670

Cool. I just installed a copy of Google Maps Mobile Beta on Nokia 6670 to test.

This sounds like the Google Maps that everybody knows on web, but actually is a stand-alone application that runs on mobile phone, so you don't have to wait for mobithe map to load via slow GPRS connection.

To make it clear, the map on mobile web is now called "Google Local" and differetiate it from the app. It's frustrating to navigate if your phone doesn't equip with Wifi. (Mobile URL: http://mobile.google.com/local)

Anyway, on this Google Maps, You can view the map in satellite view, just like the desktop web version, and also, the feature I like is that you can search some local restaurants and it gives you an option to make a call directly.

A list of the supported devices is here. The device and the provider I am using is Nokia 6670 and Cingular by the way.

If you 'd like to test it on desktop browser, go to Java demo page.

(This blog entry was originally written on Apr.25 for my other blog and copied on Blogger on Sept.26)

Monday, April 24, 2006

My Notebook

Sometimes I feel very behind and struggle to catch up with new technology... Yet, at the same time, those people who overuse (or abuse) the "buzzwords" without knowing what the hell they really mean make my eyes roll. I know the only Ajax they really know is the cleanser. Anyway, maybe I should take some notes when I learn something or find interesting. So I will treat this blog space as my own notebook or scrapbook.

Yea, I don't have any intensions to entertain people.

Ajax