I am currently developing a jQuery plugin in which I would like to remove an element, but its rejection method (slideUp, hide and other jQuery methods) is specified as an option.
For example, someone will be able to specify:
$('element').plugin({style: "slideUp", speed: 300});
and it will call slideUp for the given element.
This is a simplified example, and the plugin will do a lot more, but I'm just wondering if something like this is possible in JavaScript / jQuery. As a parallel, I'm looking for something similar to the Ruby.send () method.
Thanks!
EDIT: I found this plugin that does something similar to what I am looking for, but I would love it if there was some way to do this without including another plugin.
source share