[jQuery] Setting Opacity of an Element

[jQuery] Setting Opacity of an Element

I notice the fadeIn, fadeOut, etc. are able to set the opacity. Looking
through fx.js you find the responsible function;
---
fx.Opacity = function(a,b){
var o = new fx(a,b,"opacity");
o.cur = function(){return parseFloat(o.el.style.opacity);};
o.a = function() {
var e = o.el.style;
if (o.now == 1) o.now = 0.9999;
if (window.ActiveXObject)
e.filter = "alpha(opacity=" + o.now*100 + ")";
e.opacity = o.now;
};
o.io = o.now = 1;
o.a();
return o;
};
---
however, I can't seem to access the opacity function by itself?
e.g. to change the opacity of an element to say, 50%, does anything
exist like;
$("div#id").Opacity(50); ?
Pardon me for not being able to de-construct the source yet ;) the
z.step in the fx constructor is throwing me on loop.
~ Brice
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/




























    • Topic Participants

    • bhb