how can i creat class using Jquery
Im new at jquery script im trying to create a simple modal popup window this is my script can somebody help me?
- var box = function(h, w, content) {
- this.h = h;
- this.w = w;
- this.content = content;
- }
- $.extend(box.prototype, {
-
- showmybox: function() {
- if(popupStatus == 0){
- $("#win").css({
- display: 'block',
- width: w,
- height: h,
-
- left: ($(window).width()/2 - w /2),
- top: ($(window).height()/2 - h /2)
- });
- $('#bb').addClass('modalOverlay');
- $("#win").append(content).show(200);
- popupStatus = 1;
- }
- },
-
- closemybox: function() {
- if(popupStatus == 1){
- if(e.target.idName !== "win")
- {
- $("#win").hide(100);
- $('#bb').removeClass("modalOverlay");
- popupStatus = 0;
- return false;
- }
- }
- }
- });
now how can i call it