PHP and javascript snippets you can copy and paste.

Tuesday, May 15, 2007

js_set_opacity(el, value)

/**
* Sets an element's opacity.
* @param obj el.
* @param int val - value from 0 to 10.
* Credit: quirksmode.org
*/
function js_set_opacity(el,value){
el.style.opacity = value/10;
el.style.filter = 'alpha(opacity=' + value*10 + ')'; // IE.
}