You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
586 B
JavaScript

function Button(config){
var self = this;
self.id = config.id;
// Create DOM
var button = document.createElement("button");
button.className = "object";
button.classList.add("fader");
self.dom = button;
// Customize DOM
button.style.left = config.x+"px";
button.style.top = config.y+"px";
button.innerHTML = config.text;
// On click...
button.onclick = function(){
publish(config.message);
};
// Add...
self.add = function(INSTANT){
return _addFade(self, INSTANT);
};
// Remove...
self.remove = function(INSTANT){
return _removeFade(self, INSTANT);
};
}