Guest User

Untitled

a guest
Aug 19th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //main class
  2. function Section(){
  3. }
  4.  
  5. //constructor
  6. Section.prototype.construct = function(topOffset,offsets) {
  7.    
  8.     for (var i = 0; i < offsets.length; i++) {
  9.         if (topOffset >= offsets[i] && topOffset < offsets[i + 1]) {
  10.             this.current = offset[i];
  11.         }
  12.     }
  13.  
  14.  
  15.     return this.current;
  16. }
  17.  
  18. var Section = new Section();
  19. Section.construct(topOffset,offsets);
Advertisement
Add Comment
Please, Sign In to add comment