Friday, April 20, 2012

change the defaults from outside of plugin

My plugin is :



$.fn.iPopup = function() {
var opts = new function() {
this.width = 957;
this.height = 590;
this.left = ($(document).width() / 2) - (this.width/2) - (17/2);
this.top = 160;
}
alert (opts.width);
}


I want change the width or height when I call plugin , like:



$('div#tP').iPopup({width:280});


what should I do in my plugin?





No comments:

Post a Comment