1. #1
    Sencha User
    Join Date
    Oct 2007
    Posts
    23
    Vote Rating
    1
    bartvde is on a distinguished road

      0  

    Default The best way to get 24-bits PNG images as buttons in IE6?

    The best way to get 24-bits PNG images as buttons in IE6?


    Hello,

    what is the best way to get 24-bits PNG images with transparency to work correctly in an Ext toolbar? Right now I have hacked it in the following way:

    Code:
    // overrule to get PNG24 to be transparent in IE6
    Ext.Button.prototype.initButtonEl = function(btn, btnEl) {
            this.el = btn;
            btn.addClass("x-btn");
    
            if(this.icon){
                var browser=navigator.appName;
                var version=0;
                if (navigator.appVersion.indexOf("MSIE")!=-1) {
                  var temp=navigator.appVersion.split("MSIE");
                  version=parseFloat(temp[1])
                }
                if ((browser=="Microsoft Internet Explorer") && (version<=6)) {
                  btnEl.setStyle('filter','progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=\'true\', src=\'' + this.icon + '\', sizingMethod=\'scale\')'); } else {
                  btnEl.setStyle('background-image', 'url('+this.icon+')');
                }
            }
            if(this.iconCls){
                btnEl.addClass(this.iconCls);
                if(!this.cls){
                    btn.addClass(this.text ? 'x-btn-text-icon' : 'x-btn-icon');
                }
            }
            if(this.tabIndex !== undefined){
                btnEl.dom.tabIndex = this.tabIndex;
            }
            if(this.tooltip){
                if(typeof this.tooltip == 'object'){
                    Ext.QuickTips.register(Ext.apply({
                          target: btnEl.id
                    }, this.tooltip));
                } else {
                    btnEl.dom[this.tooltipType] = this.tooltip;
                }
            }
    
            if(this.pressed){
                this.el.addClass("x-btn-pressed");
            }
    
            if(this.handleMouseEvents){
                btn.on("mouseover", this.onMouseOver, this);
                // new functionality for monitoring on the document level
                //btn.on("mouseout", this.onMouseOut, this);
                btn.on("mousedown", this.onMouseDown, this);
            }
    
            if(this.menu){
                this.menu.on("show", this.onMenuShow, this);
                this.menu.on("hide", this.onMenuHide, this);
            }
            if(this.id){
                this.el.dom.id = this.el.id = this.id;
            }
    
            if(this.repeat){
                var repeater = new Ext.util.ClickRepeater(btn,
                    typeof this.repeat == "object" ? this.repeat : {}
                );
                repeater.on("click", this.onClick,  this);
            }
    
            btn.on(this.clickEvent, this.onClick, this);
     };

  2. #2
    Ext User
    Join Date
    Aug 2007
    Posts
    212
    Vote Rating
    0
    djfiii is on a distinguished road

      0  

    Default


    I didn't look at your code, so I don't know if it's doing this but I inlude the following pngfix.js in my ext page and it works for IE 6.

    Code:
    /*
     
    Correctly handle PNG transparency in Win IE 5.5 & 6.
    http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.
    
    Use in <HEAD> with DEFER keyword wrapped in conditional comments:
    <!--[if lt IE 7]>
    <script defer type="text/javascript" src="pngfix.js"></script>
    <![endif]-->
    
    */
    
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    
    if ((version >= 5.5) && (document.body.filters)) 
    {
       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
          }
       }
    }

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."