Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (89 sloc) 3.4 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Using noty v2 with Old Options</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="demonstration of some noty capabilities">
<link href='http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic&amp;subset=latin,latin-ext,cyrillic' rel='stylesheet' type='text/css'>
<style type="text/css">
html {
height: 100%;
width: 100%;
}
body {
font-family: 'PT Sans', Tahoma, Arial, serif; line-height: 13px
}
</style>
<link rel="stylesheet" type="text/css" href="buttons.css"/>
</head>
<body>
<div class="container">
<div id="customContainer"></div>
</div>
<script src="jquery-1.7.2.min.js"></script>
<!-- noty -->
<script type="text/javascript" src="../js/noty/jquery.noty.js"></script>
<!-- layouts -->
<script type="text/javascript" src="../js/noty/layouts/bottom.js"></script>
<script type="text/javascript" src="../js/noty/layouts/bottomCenter.js"></script>
<script type="text/javascript" src="../js/noty/layouts/bottomLeft.js"></script>
<script type="text/javascript" src="../js/noty/layouts/bottomRight.js"></script>
<script type="text/javascript" src="../js/noty/layouts/center.js"></script>
<script type="text/javascript" src="../js/noty/layouts/centerLeft.js"></script>
<script type="text/javascript" src="../js/noty/layouts/centerRight.js"></script>
<script type="text/javascript" src="../js/noty/layouts/inline.js"></script>
<script type="text/javascript" src="../js/noty/layouts/top.js"></script>
<script type="text/javascript" src="../js/noty/layouts/topCenter.js"></script>
<script type="text/javascript" src="../js/noty/layouts/topLeft.js"></script>
<script type="text/javascript" src="../js/noty/layouts/topRight.js"></script>
<!-- themes -->
<script type="text/javascript" src="../js/noty/themes/default.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.noty.returns = 'id'; // BC for old api
var n = noty({
layout: 'topLeft',
theme: 'noty_theme_default',
animateOpen: {height: 'toggle'},
animateClose: {height: 'toggle'},
easing: 'swing',
text: 'Test with old options',
type: 'alert',
speed: 500,
timeout: 5000,
closeButton: false,
closeOnSelfClick: true,
closeOnSelfOver: false,
force: false,
onShow: false,
onShown: false,
onClose: false,
onClosed: false,
buttons: [
{type: 'btn btn-primary', text: 'Ok', click: function($noty) {
// this = button element
// $noty = $noty element
$noty.close();
noty({force: true, text: 'You clicked "Ok" button', type: 'success', layout: 'topLeft'});
}
},
{type: 'btn btn-danger', text: 'Cancel', click: function($noty) {
$noty.close();
noty({force: true, text: 'You clicked "Cancel" button', type: 'error', layout: 'topLeft'});
}
}
],
modal: false,
template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
cssPrefix: 'noty_',
custom: {
container: null
}
});
console.log('html: '+n);
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.