automizy-js-api
Version:
JavaScript API library for Automizy Marketing Automation software
76 lines (73 loc) • 3.31 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>Slide Window Example</title>
<link rel="stylesheet" href="css/jquery-ui.min.css" />
<link rel="stylesheet" href="css/automizy.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/automizy.min.js"></script>
<script>
var temp;
$(function () {
var form = $A.newForm({
inputs: [
{
label: 'Subject',
type: 'text',
name: 'slide-window-subject',
breakInput: true
},
{
label: 'Description',
type: 'textarea',
name: 'slide-window-description',
breakInput: true
}
]
});
temp = $A.newSlideWindow({
tab: {
text: 'FEEDBACK'
},
title: 'If you have any issues please let us know here.',
target: $('body'),
position: "right",
positionY: '50px',
content: form,
buttons: [
{
text: 'Send',
click: function () {
$.ajax({
method: 'POST',
url: 'google.com',
data: form.widget().serializeArray(),
dataType: 'json',
complete: function (data) {
form.widget().fadeOut("slow").css({'background-color': '#ffffff'});
var $thanks = $('<div>Thank you!</div>').css({position: 'absolute', top: '30px'});
$thanks.appendTo(temp.d.$content).fadeIn("slow", function () {
setTimeout(function () {
temp.close();
setTimeout(function () {
form.widget().trigger("reset").show();
}, 500);
$thanks.stop().fadeOut(500, function () {
$thanks.remove();
form.widget().show();
});
}, 3000);
});
}
});
}
}
]
});
});
</script>
</head>
<body></body>
</html>