-
Notifications
You must be signed in to change notification settings - Fork 0
/
selectDisplayJS.js
43 lines (39 loc) · 1.33 KB
/
selectDisplayJS.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$(document).ready(
function(){
$("#picture").hide();
$(".moleculeMod").hide();
$("#selectAndDisplay").submit(function(event){
event.preventDefault();
$.ajax({
url: "/display_button",
type: "POST",
data: {molSelected: $("#chooseMol").val()},
success: function(data){
$(".showImage").html(data);
$("#picture").show();
$(".moleculeMod").show();
$("html, body").animate(
{scrollTop: $(document).height()
},
500);
},
error: function(){
alert("Molecule unavailable.");
}
});
});
$("#modifyMol").submit(function(event){
event.preventDefault();
$.ajax({
url: "/mod_svg.html",
type: "POST",
data: {axisChange: $("#xyz").val(), degreeChange: $("#degreeNum").val()},
success: function(data){
$(".showImage").html(data);
},
error: function(){
alert("Rotation cannot be made.");
}
});
});
});