Open hvck opened 11 years ago
Maybe I figured it out on my own:
I added $(".box").css({"display": "none"});
in the open function and it seems to work correctly.
In order to allow only one popbox opened at a time (if one is already open, clicking to open another one will close the first one) you just need to add methods.close(); in the script like this (4th line) :
if(box.css('display') == 'block'){
methods.close();
} else {
methods.close();
box.css({'display': 'block', 'top': 10, 'left': ((pop.parent().width()/2) -box.width()/2 )});
}
},
If you look at the original popboxes at Highrise they are pretty much modal, in the sense that if there are multiple instances on a page and you click one to open its dialog and then click another the first dialog closes and the second one opens.
With this plugin if you click on multiple links the dialogs all remain open. If they are near each other then there is overlap.
I'm not good enough at jquery or javascript to offer any suggestions on how to fix this, but I have a feeling it shouldn't be too hard.