source: trunk/phpgwapi/templates/news_old/js/hash.js @ 7836

Revision 7836, 677 bytes checked in by alexandrecorreia, 11 years ago (diff)

Ticket #3335 - Modificado o template news para a utilização de um plugin para slider

  • Property svn:executable set to *
Line 
1/*********************** HASH PROTOTYPE **************************/
2function Hash(data)     {
3        this.last_item = 0;
4        this.data = data;
5}
6Hash.prototype.size = function(){
7        var _thisObject = this;         
8        var size = 0;
9        for (var i in _thisObject.data)
10        if(_thisObject.data[i] != null)
11                size++;         
12        return size;   
13}       
14Hash.prototype.seek = function(direction){
15        var _thisObject = this;
16        _thisObject.last_item = (direction == "previous" ?
17                        (_thisObject.last_item == 0 ? _thisObject.size() - 1 : _thisObject.last_item - 1) :
18                        (_thisObject.last_item == _thisObject.size() -1 ? 0      : _thisObject.last_item + 1));
19        return _thisObject.data[_thisObject.last_item];         
20}
Note: See TracBrowser for help on using the repository browser.