EVOLUTION-NINJA
Edit File: custom.js
$(document).ready(function(){ /* ---------- Acivate Functions ---------- */ template_functions(); }); /* ---------- Template Functions ---------- */ function template_functions(){ /* ---------- Uniform ---------- */ $("input:checkbox, input:radio, input:file").not('[data-no-uniform="true"],#uniform-is-ajax').uniform(); } /* ---------- Charts ---------- */ function charts() { function randNum(){ return ((Math.floor( Math.random()* (1+40-20) ) ) + 20)* 1200; } function randNum2(){ return ((Math.floor( Math.random()* (1+40-20) ) ) + 20) * 500; } function randNum3(){ return ((Math.floor( Math.random()* (1+40-20) ) ) + 20) * 300; } function randNum4(){ return ((Math.floor( Math.random()* (1+40-20) ) ) + 20) * 100; } /* ---------- Chart with points ---------- */ if($("#stats-chart2").length) { var pageviews = [[1, 5+randNum()], [1.5, 10+randNum()], [2, 15+randNum()], [2.5, 20+randNum()],[3, 25+randNum()],[3.5, 30+randNum()],[4, 35+randNum()],[4.5, 40+randNum()],[5, 45+randNum()],[5.5, 50+randNum()],[6, 55+randNum()],[6.5, 60+randNum()],[7, 65+randNum()],[7.5, 70+randNum()],[8, 75+randNum()],[8.5, 80+randNum()],[9, 85+randNum()],[9.5, 90+randNum()],[10, 85+randNum()],[10.5, 80+randNum()],[11, 75+randNum()],[11.5, 80+randNum()],[12, 75+randNum()],[12.5, 70+randNum()],[13, 65+randNum()],[13.5, 75+randNum()],[14,80+randNum()],[14.5, 85+randNum()],[15, 90+randNum()], [15.5, 95+randNum()], [16, 5+randNum()], [16.5, 15+randNum()], [17, 15+randNum()], [17.5, 10+randNum()], [18, 15+randNum()], [18.5, 20+randNum()],[19, 25+randNum()],[19.5, 30+randNum()],[20, 35+randNum()],[20.5, 40+randNum()],[21, 45+randNum()],[21.5, 50+randNum()],[22, 55+randNum()],[22.5, 60+randNum()],[23, 65+randNum()],[23.5, 70+randNum()],[24, 75+randNum()],[24.5, 80+randNum()],[25, 85+randNum()],[25.5, 90+randNum()],[26, 85+randNum()],[26.5, 80+randNum()],[27, 75+randNum()],[27.5, 80+randNum()],[28, 75+randNum()],[28.5, 70+randNum()],[29, 65+randNum()],[29.5, 75+randNum()],[30,80+randNum()]]; var visits = [[1, randNum2()-10], [2, randNum2()-10], [3, randNum2()-10], [4, randNum2()],[5, randNum2()],[6, 4+randNum2()],[7, 5+randNum2()],[8, 6+randNum2()],[9, 6+randNum2()],[10, 8+randNum2()],[11, 9+randNum2()],[12, 10+randNum2()],[13,11+randNum2()],[14, 12+randNum2()],[15, 13+randNum2()],[16, 14+randNum2()],[17, 15+randNum2()],[18, 15+randNum2()],[19, 16+randNum2()],[20, 17+randNum2()],[21, 18+randNum2()],[22, 19+randNum2()],[23, 20+randNum2()],[24, 21+randNum2()],[25, 14+randNum2()],[26, 24+randNum2()],[27,25+randNum2()],[28, 26+randNum2()],[29, 27+randNum2()], [30, 31+randNum2()]]; var visitors = [[1, 5+randNum3()], [2, 10+randNum3()], [3, 15+randNum3()], [4, 20+randNum3()],[5, 25+randNum3()],[6, 30+randNum3()],[7, 35+randNum3()],[8, 40+randNum3()],[9, 45+randNum3()],[10, 50+randNum3()],[11, 55+randNum3()],[12, 60+randNum3()],[13, 65+randNum3()],[14, 70+randNum3()],[15, 75+randNum3()],[16, 80+randNum3()],[17, 85+randNum3()],[18, 90+randNum3()],[19, 85+randNum3()],[20, 80+randNum3()],[21, 75+randNum3()],[22, 80+randNum3()],[23, 75+randNum3()],[24, 70+randNum3()],[25, 65+randNum3()],[26, 75+randNum3()],[27,80+randNum3()],[28, 85+randNum3()],[29, 90+randNum3()], [30, 95+randNum3()]]; var newVisitors = [[1, randNum4()-10], [2, randNum4()-10], [3, randNum4()-10], [4, randNum4()],[5, randNum4()],[6, 4+randNum4()],[7, 5+randNum4()],[8, 6+randNum4()],[9, 6+randNum4()],[10, 8+randNum4()],[11, 9+randNum4()],[12, 10+randNum4()],[13,11+randNum4()],[14, 12+randNum4()],[15, 13+randNum4()],[16, 14+randNum4()],[17, 15+randNum4()],[18, 15+randNum4()],[19, 16+randNum4()],[20, 17+randNum4()],[21, 18+randNum4()],[22, 19+randNum4()],[23, 20+randNum4()],[24, 21+randNum4()],[25, 14+randNum4()],[26, 24+randNum4()],[27,25+randNum4()],[28, 26+randNum4()],[29, 27+randNum4()], [30, 31+randNum4()]]; var plot = $.plot($("#stats-chart2"), [ { data: visitors, label: "Visits", lines: { show: true, fill: false, lineWidth: 2 }, shadowSize: 0 }, { data: pageviews, bars: { show: true, fill: false, barWidth: 0.1, align: "center", lineWidth: 5, } } ], { grid: { hoverable: true, clickable: true, tickColor: "rgba(255,255,255,0.05)", borderWidth: 0 }, legend: { show: false }, colors: ["rgba(255,255,255,0.8)", "rgba(255,255,255,0.6)", "rgba(255,255,255,0.4)", "rgba(255,255,255,0.2)"], xaxis: {ticks:15, tickDecimals: 0, color: "rgba(255,255,255,0.8)" }, yaxis: {ticks:5, tickDecimals: 0, color: "rgba(255,255,255,0.8)" }, }); /* [ { data: visitors, label: "Visits"}], { series: { lines: { show: true, lineWidth: 2 }, points: { show: true, lineWidth: 2 }, shadowSize: 0 }, grid: { hoverable: true, clickable: true, tickColor: "rgba(255,255,255,0.025)", borderWidth: 0 }, legend: { show: false }, colors: ["rgba(255,255,255,0.8)", "rgba(255,255,255,0.6)", "rgba(255,255,255,0.4)", "rgba(255,255,255,0.2)"], xaxis: {ticks:15, tickDecimals: 0}, yaxis: {ticks:5, tickDecimals: 0}, }); */ var previousPoint = null; $("#stats-chart2").bind("plothover", function (event, pos, item) { $("#x").text(pos.x.toFixed(2)); $("#y").text(pos.y.toFixed(2)); if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2); showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y); } } else { $("#tooltip").remove(); previousPoint = null; } }); } function randNumFB(){ return ((Math.floor( Math.random()* (1+40-20) ) ) + 20); } /* ---------- Chart with points ---------- */ if($("#twitterChart").length) { var followers = [[1, 5+randNumTW()], [2, 10+randNumTW()], [3, 15+randNumTW()], [4, 20+randNumTW()],[5, 25+randNumTW()],[6, 30+randNumTW()],[7, 35+randNumTW()],[8, 40+randNumTW()],[9, 45+randNumTW()],[10, 50+randNumTW()],[11, 55+randNumTW()],[12, 60+randNumTW()],[13, 65+randNumTW()],[14, 70+randNumTW()],[15, 75+randNumTW()],[16, 80+randNumTW()],[17, 85+randNumTW()],[18, 90+randNumTW()],[19, 85+randNumTW()],[20, 80+randNumTW()],[21, 75+randNumTW()],[22, 80+randNumTW()],[23, 75+randNumTW()],[24, 70+randNumTW()],[25, 65+randNumTW()],[26, 75+randNumTW()],[27,80+randNumTW()],[28, 85+randNumTW()],[29, 90+randNumTW()], [30, 95+randNumTW()]]; var plot = $.plot($("#twitterChart"), [ { data: followers, label: "Followers"} ], { series: { lines: { show: true, lineWidth: 2, fill: true, fillColor: { colors: [ { opacity: 0.5 }, { opacity: 0.2 } ] } }, points: { show: true, lineWidth: 2 }, shadowSize: 0 }, grid: { hoverable: true, clickable: true, tickColor: "#f9f9f9", borderWidth: 0 }, colors: ["#1BB2E9"], xaxis: {ticks:6, tickDecimals: 0}, yaxis: {ticks:3, tickDecimals: 0}, }); function showTooltip(x, y, contents) { $('<div id="tooltip">' + contents + '</div>').css( { position: 'absolute', display: 'none', top: y + 5, left: x + 5, border: '1px solid #fdd', padding: '2px', 'background-color': '#dfeffc', opacity: 0.80 }).appendTo("body").fadeIn(200); } var previousPoint = null; $("#twitterChart").bind("plothover", function (event, pos, item) { $("#x").text(pos.x.toFixed(2)); $("#y").text(pos.y.toFixed(2)); if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2); showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y); } } else { $("#tooltip").remove(); previousPoint = null; } }); } if($("#activeUsers").length) { var d1 = []; for (var i = 0; i <= 160; i += 1) { d1.push([i, parseInt(Math.random() * 123123)]); } var stack = 0, bars = true, lines = false, steps = false; function plotWithOptions2() { $.plot($("#activeUsers"), [ d1 ], { series: { bars: { show: bars, fill: true, barWidth: 0.1, align: "center", lineWidth: 5, fillColor: { colors: [ { opacity: 1 }, { opacity: 0.5 } ] } }, }, grid: { hoverable: true, clickable: true, tickColor: "#f6f6f6", borderWidth: 0, }, colors: ["#CBE968"], xaxis: {ticks:0, tickDecimals: 0, tickFormatter: function(v, a) {return v }}, yaxis: {ticks:5, tickDecimals: 0, tickFormatter: function (v) { return v }}, }); } plotWithOptions2(); } /* ---------- Chart with points ---------- */ if($("#stats-chart").length) { var visitors = [[1, randNum()-10], [2, randNum()-10], [3, randNum()-10], [4, randNum()],[5, randNum()],[6, 4+randNum()],[7, 5+randNum()],[8, 6+randNum()],[9, 6+randNum()],[10, 8+randNum()],[11, 9+randNum()],[12, 10+randNum()],[13,11+randNum()],[14, 12+randNum()],[15, 13+randNum()],[16, 14+randNum()],[17, 15+randNum()],[18, 15+randNum()],[19, 16+randNum()],[20, 17+randNum()],[21, 18+randNum()],[22, 19+randNum()],[23, 20+randNum()],[24, 21+randNum()],[25, 14+randNum()],[26, 24+randNum()],[27,25+randNum()],[28, 26+randNum()],[29, 27+randNum()], [30, 31+randNum()]]; var plot = $.plot($("#stats-chart"), [ { data: visitors, label: "visitors" } ], { series: { lines: { show: true, lineWidth: 3, fill: true, fillColor: { colors: [ { opacity: 0.5 }, { opacity: 0.2 } ] } }, points: { show: true }, shadowSize: 2 }, grid: { hoverable: true, clickable: true, tickColor: "#eee", borderWidth: 0, }, colors: ["#b1d3d4"], xaxis: {ticks:11, tickDecimals: 0}, yaxis: {ticks:11, tickDecimals: 0}, }); function showTooltip(x, y, contents) { $('<div id="tooltip">' + contents + '</div>').css( { position: 'absolute', display: 'none', top: y + 5, left: x + 5, border: '1px solid #fdd', padding: '2px', 'background-color': '#dfeffc', opacity: 0.80 }).appendTo("body").fadeIn(200); } var previousPoint = null; $("#stats-chart").bind("plothover", function (event, pos, item) { $("#x").text(pos.x.toFixed(2)); $("#y").text(pos.y.toFixed(2)); if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2); showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y); } } else { $("#tooltip").remove(); previousPoint = null; } }); $("#sincos").bind("plotclick", function (event, pos, item) { if (item) { $("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + "."); plot.highlight(item.series, item.datapoint); } }); } /* ---------- Chart with points ---------- */ if($("#sincos").length) { var sin = [], cos = []; for (var i = 0; i < 14; i += 0.5) { sin.push([i, Math.sin(i)/i]); cos.push([i, Math.cos(i)]); } var plot = $.plot($("#sincos"), [ { data: sin, label: "sin(x)/x"}, { data: cos, label: "cos(x)" } ], { series: { lines: { show: true, lineWidth: 2, }, points: { show: true }, shadowSize: 2 }, grid: { hoverable: true, clickable: true, tickColor: "#dddddd", borderWidth: 0 }, yaxis: { min: -1.2, max: 1.2 }, colors: ["#FA5833", "#2FABE9"] }); function showTooltip(x, y, contents) { $('<div id="tooltip">' + contents + '</div>').css( { position: 'absolute', display: 'none', top: y + 5, left: x + 5, border: '1px solid #fdd', padding: '2px', 'background-color': '#dfeffc', opacity: 0.80 }).appendTo("body").fadeIn(200); } var previousPoint = null; $("#sincos").bind("plothover", function (event, pos, item) { $("#x").text(pos.x.toFixed(2)); $("#y").text(pos.y.toFixed(2)); if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2); showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y); } } else { $("#tooltip").remove(); previousPoint = null; } }); $("#sincos").bind("plotclick", function (event, pos, item) { if (item) { $("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + "."); plot.highlight(item.series, item.datapoint); } }); } /* ---------- Flot chart ---------- */ if($("#flotchart").length) { var d1 = []; for (var i = 0; i < Math.PI * 2; i += 0.25) d1.push([i, Math.sin(i)]); var d2 = []; for (var i = 0; i < Math.PI * 2; i += 0.25) d2.push([i, Math.cos(i)]); var d3 = []; for (var i = 0; i < Math.PI * 2; i += 0.1) d3.push([i, Math.tan(i)]); $.plot($("#flotchart"), [ { label: "sin(x)", data: d1}, { label: "cos(x)", data: d2}, { label: "tan(x)", data: d3} ], { series: { lines: { show: true }, points: { show: true } }, xaxis: { ticks: [0, [Math.PI/2, "\u03c0/2"], [Math.PI, "\u03c0"], [Math.PI * 3/2, "3\u03c0/2"], [Math.PI * 2, "2\u03c0"]] }, yaxis: { ticks: 10, min: -2, max: 2 }, grid: { tickColor: "#dddddd", borderWidth: 0 }, colors: ["#FA5833", "#2FABE9", "#FABB3D"] }); } /* ---------- Stack chart ---------- */ if($("#stackchart").length) { var d1 = []; for (var i = 0; i <= 10; i += 1) d1.push([i, parseInt(Math.random() * 30)]); var d2 = []; for (var i = 0; i <= 10; i += 1) d2.push([i, parseInt(Math.random() * 30)]); var d3 = []; for (var i = 0; i <= 10; i += 1) d3.push([i, parseInt(Math.random() * 30)]); var stack = 0, bars = true, lines = false, steps = false; function plotWithOptions() { $.plot($("#stackchart"), [ d1, d2, d3 ], { series: { stack: stack, lines: { show: lines, fill: true, steps: steps }, bars: { show: bars, barWidth: 0.6 }, }, colors: ["#FA5833", "#2FABE9", "#FABB3D"] }); } plotWithOptions(); $(".stackControls input").click(function (e) { e.preventDefault(); stack = $(this).val() == "With stacking" ? true : null; plotWithOptions(); }); $(".graphControls input").click(function (e) { e.preventDefault(); bars = $(this).val().indexOf("Bars") != -1; lines = $(this).val().indexOf("Lines") != -1; steps = $(this).val().indexOf("steps") != -1; plotWithOptions(); }); } /* ---------- Device chart ---------- */ var data = [ { label: "Desktop", data: 73}, { label: "Mobile", data: 27} ]; /* ---------- Donut chart ---------- */ if($("#deviceChart").length) { $.plot($("#deviceChart"), data, { series: { pie: { innerRadius: 0.6, show: true } }, legend: { show: true }, colors: ["#FA5833", "#2FABE9", "#FABB3D", "#78CD51"] }); } var data = [ { label: "iOS", data: 20}, { label: "Android", data: 7}, { label: "Linux", data: 11}, { label: "Mac OSX", data: 14}, { label: "Windows", data: 48} ]; /* ---------- Donut chart ---------- */ if($("#osChart").length) { $.plot($("#osChart"), data, { series: { pie: { innerRadius: 0.6, show: true } }, legend: { show: true }, colors: ["#FA5833", "#2FABE9", "#FABB3D", "#78CD51"] }); } /* ---------- Pie chart ---------- */ var data = [ { label: "Internet Explorer", data: 12}, { label: "Mobile", data: 27}, { label: "Safari", data: 85}, { label: "Opera", data: 64}, { label: "Firefox", data: 90}, { label: "Chrome", data: 112} ]; if($("#piechart").length) { $.plot($("#piechart"), data, { series: { pie: { show: true } }, grid: { hoverable: true, clickable: true }, legend: { show: false }, colors: ["#FA5833", "#2FABE9", "#FABB3D", "#78CD51"] }); function pieHover(event, pos, obj) { if (!obj) return; percent = parseFloat(obj.series.percent).toFixed(2); $("#hover").html('<span style="font-weight: bold; color: '+obj.series.color+'">'+obj.series.label+' ('+percent+'%)</span>'); } $("#piechart").bind("plothover", pieHover); } /* ---------- Donut chart ---------- */ if($("#donutchart").length) { $.plot($("#donutchart"), data, { series: { pie: { innerRadius: 0.5, show: true } }, legend: { show: false }, colors: ["#FA5833", "#2FABE9", "#FABB3D", "#78CD51"] }); } // we use an inline data source in the example, usually data would // be fetched from a server var data = [], totalPoints = 300; function getRandomData() { if (data.length > 0) data = data.slice(1); // do a random walk while (data.length < totalPoints) { var prev = data.length > 0 ? data[data.length - 1] : 50; var y = prev + Math.random() * 10 - 5; if (y < 0) y = 0; if (y > 100) y = 100; data.push(y); } // zip the generated y values with the x values var res = []; for (var i = 0; i < data.length; ++i) res.push([i, data[i]]) return res; } // setup control widget var updateInterval = 30; $("#updateInterval").val(updateInterval).change(function () { var v = $(this).val(); if (v && !isNaN(+v)) { updateInterval = +v; if (updateInterval < 1) updateInterval = 1; if (updateInterval > 2000) updateInterval = 2000; $(this).val("" + updateInterval); } }); /* ---------- Realtime chart ---------- */ if($("#serverLoad").length) { var options = { series: { shadowSize: 1 }, lines: { show: true, lineWidth: 3, fill: true, fillColor: { colors: [ { opacity: 0.9 }, { opacity: 0.9 } ] }}, yaxis: { min: 0, max: 100, tickFormatter: function (v) { return v + "%"; }}, xaxis: { show: false }, colors: ["#FA5833"], grid: { tickColor: "#f9f9f9", borderWidth: 0, }, }; var plot = $.plot($("#serverLoad"), [ getRandomData() ], options); function update() { plot.setData([ getRandomData() ]); // since the axes don't change, we don't need to call plot.setupGrid() plot.draw(); setTimeout(update, updateInterval); } update(); } if($("#serverLoad2").length) { var options = { series: { shadowSize: 1 }, lines: { show: true, lineWidth: 2, fill: true, fillColor: { colors: [ { opacity: 0.9 }, { opacity: 0.9 } ] }}, yaxis: { min: 0, max: 100, tickFormatter: function (v) { return v + "%"; }, color: "rgba(255,255,255,0.8)"}, xaxis: { show: false, color: "rgba(255,255,255,0.8)" }, colors: ["rgba(255,255,255,0.95)"], grid: { tickColor: "rgba(255,255,255,0.15)", borderWidth: 0, }, }; var plot = $.plot($("#serverLoad2"), [ getRandomData() ], options); function update() { plot.setData([ getRandomData() ]); // since the axes don't change, we don't need to call plot.setupGrid() plot.draw(); setTimeout(update, updateInterval); } update(); } if($("#realtimechart").length) { var options = { series: { shadowSize: 1 }, lines: { fill: true, fillColor: { colors: [ { opacity: 1 }, { opacity: 0.1 } ] }}, yaxis: { min: 0, max: 100 }, xaxis: { show: false }, colors: ["#F4A506"], grid: { tickColor: "#dddddd", borderWidth: 0 }, }; var plot = $.plot($("#realtimechart"), [ getRandomData() ], options); function update() { plot.setData([ getRandomData() ]); // since the axes don't change, we don't need to call plot.setupGrid() plot.draw(); setTimeout(update, updateInterval); } update(); } } function growlLikeNotifications() { $('#add-sticky').click(function(){ var unique_id = $.gritter.add({ // (string | mandatory) the heading of the notification title: 'This is a sticky notice!', // (string | mandatory) the text inside the notification text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.', // (string | optional) the image to display on the left image: 'img/avatar.jpg', // (bool | optional) if you want it to fade out on its own or just sit there sticky: true, // (int | optional) the time you want it to be alive for before fading out time: '', // (string | optional) the class name you want to apply to that specific message class_name: 'my-sticky-class' }); // You can have it return a unique id, this can be used to manually remove it later using /* ---------- setTimeout(function(){ $.gritter.remove(unique_id, { fade: true, speed: 'slow' }); }, 6000) */ return false; }); $('#add-regular').click(function(){ return false; }); $('#add-max').click(function(){ $.gritter.add({ // (string | mandatory) the heading of the notification title: 'This is a notice with a max of 3 on screen at one time!', // (string | mandatory) the text inside the notification text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.', // (string | optional) the image to display on the left image: 'img/avatar.jpg', // (bool | optional) if you want it to fade out on its own or just sit there sticky: false, // (function) before the gritter notice is opened before_open: function(){ if($('.gritter-item-wrapper').length == 3) { // Returning false prevents a new gritter from opening return false; } } }); return false; }); $('#add-without-image').click(function(){ return false; }); $('#add-gritter-light').click(function(){ return false; }); $('#add-with-callbacks').click(function(){ $.gritter.add({ // (string | mandatory) the heading of the notification title: 'This is a notice with callbacks!', // (string | mandatory) the text inside the notification text: 'The callback is...', // (function | optional) function called before it opens before_open: function(){ alert('I am called before it opens'); }, // (function | optional) function called after it opens after_open: function(e){ alert("I am called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e); }, // (function | optional) function called before it closes before_close: function(e, manual_close){ var manually = (manual_close) ? 'The "X" was clicked to close me!' : ''; alert("I am called before it closes: I am passed the jQuery object for the Gritter element... \n" + manually); }, // (function | optional) function called after it closes after_close: function(e, manual_close){ var manually = (manual_close) ? 'The "X" was clicked to close me!' : ''; alert('I am called after it closes. ' + manually); } }); return false; }); $('#add-sticky-with-callbacks').click(function(){ $.gritter.add({ // (string | mandatory) the heading of the notification title: 'This is a sticky notice with callbacks!', // (string | mandatory) the text inside the notification text: 'Sticky sticky notice.. sticky sticky notice...', // Stickeh! sticky: true, // (function | optional) function called before it opens before_open: function(){ alert('I am a sticky called before it opens'); }, // (function | optional) function called after it opens after_open: function(e){ alert("I am a sticky called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e); }, // (function | optional) function called before it closes before_close: function(e){ alert("I am a sticky called before it closes: I am passed the jQuery object for the Gritter element... \n" + e); }, // (function | optional) function called after it closes after_close: function(){ alert('I am a sticky called after it closes'); } }); return false; }); $("#remove-all").click(function(){ $.gritter.removeAll(); return false; }); $("#remove-all-with-callbacks").click(function(){ $.gritter.removeAll({ before_close: function(e){ alert("I am called before all notifications are closed. I am passed the jQuery object containing all of Gritter notifications.\n" + e); }, after_close: function(){ alert('I am called after everything has been closed.'); } }); return false; }); }