Variable sized popup window
I have a mysql/php generated list of checkboxes, all assigned to admins of the site that I'm working on. To change assignments (checkboxes), I've got a popup displaying the list with a save button at the bottom. The problem is, as I'm adding more admins, the list extends o开发者_StackOverflowff the size of the popup box, and I'd like to find a way to make sure the popup expands to accomodate each checkbox.
Here's my javascript:
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=280,height=485');");
}
Some html:
<input type="button" value="Change Admin Assignment" onClick="popUp('changeuseradmin.php?user='+$('#userDropDown').val())"><br /><br /></td></td>
What do you think would be the best way of going about doing this?
The best way would be to start using the jQuery UI library:
http://jqueryui.com/demos/dialog/
精彩评论