Skip to content

Instantly share code, notes, and snippets.

@fabriziomachado
Created December 7, 2011 16:07
Show Gist options
  • Save fabriziomachado/1443363 to your computer and use it in GitHub Desktop.
Save fabriziomachado/1443363 to your computer and use it in GitHub Desktop.
assets/js/application.js
var url = 'http://localhost/codeigniter-academic/assets/images/photos/';
// with NowJs
$(document).ready(function(){
// JQuery notify
$container = $("#container").notify();
//Channel to emit notify
now.notify = function(title, message){
$("#container").notify("create", "sticky", {
title: title,
text: message
});
}
//Channel to emit resize
now.resize = function(message){
$("#photos").append("<img src='" + url + message + "'/ >");
$("#container").notify("create", "sticky", {
title: 'RESIZE IMAGE',
text: message
});
}
// Channel to emit pong message
now.pong = function(title, message){
$("#container").notify("create", "sticky", {
title: title,
text: message
});
}
$('#ping-pong-everyone').click(function() {
now.ping('everyone'); // function server
});
$('#ping-pong-this').click(function() {
now.ping('this'); // function server
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment