Created
February 7, 2012 00:37
-
-
Save roxlu/1756203 to your computer and use it in GitHub Desktop.
Sliding in DOM elements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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