I would like to know how to combine the functions of different selectors. All the functions open and close dialogs, but different dialogs. So I don't know if it's possible. It just looks wrong and if someone saw it they would call me an idiot. Right now I have:
$(document).ready(function() {
$('div#basic_dialog').dialog({
autoOpen: false,
buttons: {
"Close": function () {
$('div#basic_dialog').dialog("close");
window.location.href = "#contact";
}
}
})
$('#basic_dialog_button').click(function(){ $('div#basic_dialog').dialog('open'); });
$('div#caption_dialog').dialog({
autoOpen: false,
buttons: {
"Close": function () {
$('div#caption_dialog').dialog("close");
window.location.href = "#contact";
}
}
})
$('#caption_dialog_button').click(function(){ $('div#caption_dialog').dialog('open'); });
$('div#plus_dialog').dialog({
autoOpen: false,
buttons: {
"Close": function () {
$('div#plus_dialog').dialog("close");
window.location.href = "#contact";
}
}
})
$('#plus_dialog_button').click(function(){ $('div#plus_dialog').dialog('open'); });
$('div#skills_dialog').dialog({
autoOpen: false,
buttons: {
"Close": function () {
$('div#skills_dialog').dialog("close");
window.location.href = "#contact";
}
}
})
$('#skills_dialog_button').click(function(){ $('div#skills_dialog').dialog('open'); });
})
But I'm pretty sure that can be prettified somehow. They all open and close different boxes, so I don't know. I know how to do it if they were all doing the exact same function, but mapping that change is beyond me right now.