var Tips4 = new Tips($$('.Tips4'), { className: 'custom', initialize:function(){ div = new Element('div', { 'styles': { 'position': 'absolute', 'top': '0', 'left': '0', 'z-index': '400', 'background-color': 'black' } }); div.injectBefore('accordion'); this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0); this.divfx = new Fx.Style(div, 'opacity', {duration: 1000, wait: false}).set(0); }, onShow: function(toolTip) { div.setStyles({ 'height': toolTip.getStyle('height'), 'width': toolTip.getStyle('width'), 'left': (toolTip.getStyle('left').toInt() + 10)+'px', 'top': (toolTip.getStyle('top').toInt() + 10)+'px' }); this.fx.start(1); this.divfx.start(0.5); }, onHide: function(toolTip) { this.fx.start(0); this.divfx.start(0); } });