Archives

You are currently viewing archive for 22 June 2007
Category: Web dev
Posted by: hajime osako
とほほのスタイルシート入門

/**
 * change Opacity
 * @param string id
 * @param integer  num 0% to 100%
 */
function _changeOpacity(id, num)
{
   if(document.all)
   {
      document.getElementById(id).style.filter="alpha(opacity=0)";
      document.getElementById(id).filters.alpha.opacity  = num;
   }
   else if(ua.indexOf('Gecko')!=-1)
   {
      document.getElementById(id).style.MozOpacity = (num / 100);
   }
}
Category: Web dev
Posted by: hajime osako
Array.indexOf in Internet Explorer - soledad penad�s
if(!Array.indexOf){
   Array.prototype.indexOf = function(obj){
      for(var i=0; i<this.length; i++){
         if(this[i]==obj){
            return i;
         }
      }
      return -1;
   }
}