Hello,

I need help.
I have thjis plugin

(function($){
$.fn.btnInit = function() {
  function prepare(obj, caption, action) {
    obj
        .html(caption)
        .addClass("fg-button ui-state-default ui-corner-all")
        .click(function(){
                  // run the action here when click triggered
                   alert('Do some action');});
        };

        return this.each(function(caption, action){
                obj = $(this);
                prepare(obj, caption, action);
        });

};


})(jQuery);


and the problem is how do I modify the click event so that it can
accept function as below

$(".btnA").btnInit("Button A", function () { do some action 1 });
$(".btnB").btnInit("Button B", function () { do some action 2 });

different button will have a different action.

I'm stuck here. Pls help

Thanks


Reply via email to