Re: [jQuery] Passing typeof function

2009-11-06 Thread waseem sabjee
lets assume the following markup a button | a button | a button | a button you want to be able to differentiate between the buttons on click event var obj = $(".button"); obj.click(function(e) { e.preventDefault(); var index = obj.index($(this)); alert("my button index is "+index); }); this

[jQuery] Passing typeof function

2009-11-06 Thread aze
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