var Bouton = function(classe,type,largeur,hauteur){ var type=type||'defaut'; var la=largeur||'auto'; var ha=hauteur||'auto'; this.init = function() { var nbout=$$(classe); nbout.each(function (item, index){ var Props =item.getProperties('value', 'data-ico','onclick'); var ico=item.getProperty('data-ico'); var icopos=item.getProperty('data-ico-pos'); if(icopos) {var style='height:100%; position:relative;display:inline-block;float:'+icopos;} else {var style='position:relative;display:inline-block;float:left';} if(ico){var htmlvalue=''+Props.value;} else {var htmlvalue=Props.value;} item.setStyle ('display','none'); var mydiv = new Element('div', { 'class': type+'-btn ekla-btn', html:htmlvalue, styles: { height:ha, width:la }, events: { click: function(){ eval(Props.onclick); } } }); mydiv.inject(item,'before'); }); } } var BoutonClassic = function(classe,type){ var type=type||'defaut'; this.init = function() { var nbout=$$(classe); nbout.each(function (item, index){ item.setProperties({ class: item.getProperty('class')+' ekla-btn '+type+'-btn' }); }); } }