Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created February 7, 2012 00:37
Show Gist options
  • Select an option

  • Save roxlu/1756203 to your computer and use it in GitHub Desktop.

Select an option

Save roxlu/1756203 to your computer and use it in GitHub Desktop.
Sliding in DOM elements.
var dewars = null;
var Site = new Class({
initialize: function() {
this.initListUpdater();
}
,initListUpdater:function() {
var list = $('last');
var li = null;
var update = function() {
li = list.getElement('li');
if(!li) {
return;
}
var id = li.get('class').split(' ')[0].split('_')[1];
//(id-1)
var req = new Request.HTML({
url:"/?act=new_row&id=" +4
,onComplete:function(responseTree, responseEls, html) {
if(responseTree && responseTree[0]) {
var el = responseTree[0].inject(list, 'top');
var slide = new Fx.Slide(el, {mode:'vertical'}).hide().slideIn();
}
}
}).send();
}
update.periodical(2400);
}
});
document.addEvent('domready', function() {
dewars = new Site();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment