(function( $ ) {
$.fn.tcDialogue = function(options) {
$('body').append("hello");
var closeDialogue = function(other_args) {
alert("I would close if I was written");
};
};
}(jQuery));
$(document).ready(function (){
var testDialogue = tcDialogue();
testDialogue.closeDialogue();
});
(function ($) {
$.fn.tcDialogue = function (options) {
this.append("hello");
var closeDialogue = function (other_args) {
alert("I would close if I was written");
};
return {
closeDialogue: closeDialogue
};
};
}(jQuery));
$(document).ready(function () {
var testDialogue = $('body').tcDialogue();
testDialogue.closeDialogue();
});
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Here's an example that uses it:
http://jsfiddle.net/BvssN/1/
Open in new window