I ran across this bug today and wrote some quick code that fixed it in
Prototype 1.5.0, so maybe this was already fixed but I'm posting it
just in case.

What happens is that Scriptaculous' Sortable.create is used over a
table the transparency effect it produces while dragging simply
doesn't show the element on IE. When I saw this I quickly recalled
that opacity effects in IE are done through filters which don't work
right on many situations. So I devised this solution:


setStyle: function(element, style) {
    element = $(element);
    for (var name in style) {
      var value = style[name];
      if(name == 'opacity') {

                /* Fix for IE 6/7: when setting opacity on a tr element the 
filter
simply doesn't working hiding the contents of the table while
dragging.
                This code calls setStyle() on every TD so that it works 
properly.
                This problem does not happen in Gecko-based browsers.
                */
                if(/MSIE/.test(navigator.userAgent))
                {
                        if(element.tagName == 'TR')
                        {

                                for(var i = 0; i < element.cells.length; ++i)
                                {
                                        var td = element.cells[i];
                                        Element.setStyle(td, { opacity: value 
});
                                }
                                // ignore the standard setStyle code for this 
property.
                                continue;
                        }
                }
                // fix ends here.

        if (value == 1) {
          value = (/Gecko/.test(navigator.userAgent) &&
            !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ?
0.999999 : 1.0;
          if(/MSIE/.test(navigator.userAgent) && !window.opera)
            element.style.filter = element.getStyle('filter').replace(/
alpha\([^\)]*\)/gi,'');
        } else if(value === '') {
          if(/MSIE/.test(navigator.userAgent) && !window.opera)
            element.style.filter = element.getStyle('filter').replace(/
alpha\([^\)]*\)/gi,'');
        } else {
          if(value < 0.00001) value = 0;
          if(/MSIE/.test(navigator.userAgent) && !window.opera)
            element.style.filter = element.getStyle('filter').replace(/
alpha\([^\)]*\)/gi,'') +
              'alpha(opacity='+value*100+')';
        }
      } else if(['float','cssFloat'].include(name)) name = (typeof
element.style.styleFloat != 'undefined') ? 'styleFloat' : 'cssFloat';
      element.style[name.camelize()] = value;
    }
    return element;
  },

What it does is simply call setStyle on every cell of the TR element
so they become property transparent.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to