Guest User

Untitled

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