[jQuery] Help on jQuery plugin
Hi All,
I have a plug-in that adds onclick event to an element, below is a
snippet?
jQuery.fn.showBox = function(options) {
var options = {title:"the title",content:"the content"};
return this.each(function(){
var obj = $(this);
obj.bind("click",function(e){
// perform dynamic div show
// add and show a div box below element
});
});
}
Now here is my question, is there a way I can make the same function
so that I can call it as a method of jquery without recreating the
code for adding and showing the div box.
What I need is to call this showBox (as $.showBox(options)) and will
perform the dynamic div?
Any help is much appreciated.
Thanks.