|
119 | 119 | // Update the values for `sections` |
120 | 120 | var calculateSectionBottoms = function () { |
121 | 121 | var tmpSections = []; |
| 122 | + sectionWrapperTop = Math.round( |
| 123 | + sectionWrapper.position().top |
| 124 | + + parseInt(sectionWrapper.css('paddingTop'), 10) |
| 125 | + + parseInt(sectionWrapper.css('borderTopWidth'), 10) |
| 126 | + + parseInt(sectionWrapper.css('marginTop'), 10)); |
| 127 | + |
| 128 | + // We use `height()` instead of `innerHeight()` or `outerHeight()` |
| 129 | + // because we don't care about the padding in the sectionWrapper at the bottom |
| 130 | + sectionWrapperBottom = Math.round( |
| 131 | + sectionWrapperTop |
| 132 | + + sectionWrapper.height(), 10); |
| 133 | + |
122 | 134 | $(options.sectionSelector).each(function (i, el) { |
123 | | - sectionWrapperTop = Math.round( |
124 | | - sectionWrapper.position().top |
125 | | - + parseInt(sectionWrapper.css('paddingTop'), 10) |
126 | | - + parseInt(sectionWrapper.css('borderTopWidth'), 10) |
127 | | - + parseInt(sectionWrapper.css('marginTop'), 10)); |
128 | | - |
129 | | - // We use `height()` instead of `innerHeight()` or `outerHeight()` |
130 | | - // because we don't care about the padding in the sectionWrapper at the bottom |
131 | | - sectionWrapperBottom = Math.round( |
132 | | - sectionWrapperTop |
133 | | - + sectionWrapper.height(), 10); |
134 | | - |
135 | 135 | tmpSections.push(Math.round( |
136 | 136 | sectionWrapperTop |
137 | 137 | + $(el).position().top // This will be relative to the sectionWrapper |
|
0 commit comments