Global var with jquery plugin
Hi all,
I make my personal plugin dialog because I can make a theme design with the jQuery UI dialog.
I want to use a global variable for each window dialog.
This is my code :
-
$.fn.myDialog = function(options)
{
// Options
var zIndex = 100;
var settings = {
};
options = $.extend(settings, options);
// Each
this.each(function()
{
init($(this));
});
/*
* INIT
****************************************/
// Init
function init(me)
{
alert(zIndex);
zIndex++;
}
};
But I have only 100 and never 101,102,...
What can I do for that ??
Thank you all