mootools/mootools-core — Issue #2149: Inconsistency in setStyle('opacity, 0) and set('opacity', 0)
Author: rhuynh
Created: 2011-12-01 23:30:30+00:00
State: open

I upgraded to mootools 1.4.1 (with compatibility) from 1.2.5 and noticed that in 1.4.1 there is an inconsistency in the behavior when you set the opacity of an element to 0 using setStyle() vs set(). Using Element.set('opacity', 0), what you will see is that the element visibility will also be changed to hidden but this is not the case w/ Element.setStyle('opacity', 0). Shouldn't the behavior be the same?

Looking at mootools core, i see this for setStyle():

setStyle: function(property, value){
if (property == 'opacity'){
setOpacity(this, parseFloat(value));
return this;
}

as opposed to set():

Element.Properties.opacity = {

set: function(opacity){
setOpacity(this, opacity);
setVisibility(this, opacity);
},