// vars var read_more_div_fx = ''; var highlightfxarray = new Array(); // dom ready window.addEvent('domready', function() { // vars read_more_div_fx = new Fx.Slide('read_more_div',{duration:1000,wait:false}).hide(); // events for hoverable elements $$('.hoverable').each(function(el,index){ highlightfxarray.push(new highlight_controller({element:el,highlighted_colour:'#fff3af',normal_colour:'#ffffff'})); }); }); // read more function function rm() { if ($('read_more_lnk').innerHTML == 'read more') { $('read_more_lnk').innerHTML = 'read less'; } else { $('read_more_lnk').innerHTML = 'read more'; } read_more_div_fx.toggle(); } // class to highlight objects var highlight_controller = new Class({ initialize: function(options) { // vars var el = options.element.getElement('.hov'); if (el == null) return(false); this.hfx = new Fx.Style(el, 'background-color',{wait:false,duration:300}); this.options = options; // add events options.element.addEvents({ 'mouseover':function() { this.hfx.start(this.options.highlighted_colour); }.bind(this), 'mouseleave':function() { this.hfx.start(this.options.normal_colour); }.bind(this) }); } });