Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main class
- function Section(){
- this.current;
- }
- //constructor
- Section.prototype.construct = function(topOffset,offsets) {
- for (var i = 0; i < offsets.length; i++) {
- if (topOffset >= offsets[i] && topOffset < offsets[i + 1]) {
- this.current = offset[i];
- }
- }
- }
- //get current
- Section.prototype.getCurrent = function() {
- return this.current;
- }
- var Section = new Section();
- Section.construct(topOffset,offsets);
Advertisement
Add Comment
Please, Sign In to add comment