Menu icon Foundation
Uncaught TypeError: Cannot read property 'top' of undefined at Sticky

Foundation 6.4.2

Found this error in Console:

Uncaught TypeError: Cannot read property 'top' of undefined
    at Sticky._parsePoints (foundation.js:10631)
    at foundation.js:10595
    at fn (jquery.js:4955)
    at dispatch (jquery.js:5206)
    at elemData.handle (jquery.js:5014)

I'm sure its because my "sticky navigation":

<div data-sticky-container>
    <div class="title-bar show-for-medium" data-sticky data-options="marginTop:0;" style="width:100%" data-top-anchor="1" data-btm-anchor="content:bottom">
        <div class="title-bar-left"><ul class="menu">
            <li class="menu-text">Site Title</li>
            <li><a href="#">One</a></li>
            <li><a href="#">Two</a></li>
            <li><a href="#">Three</a></li>
        </ul></div>
        <div class="title-bar-right"><!-- Content --></div>
    </div>
</div>

Is this a bug?

 

 

javascript

Foundation 6.4.2

Found this error in Console:

Uncaught TypeError: Cannot read property 'top' of undefined
    at Sticky._parsePoints (foundation.js:10631)
    at foundation.js:10595
    at fn (jquery.js:4955)
    at dispatch (jquery.js:5206)
    at elemData.handle (jquery.js:5014)

I'm sure its because my "sticky navigation":

<div data-sticky-container>
    <div class="title-bar show-for-medium" data-sticky data-options="marginTop:0;" style="width:100%" data-top-anchor="1" data-btm-anchor="content:bottom">
        <div class="title-bar-left"><ul class="menu">
            <li class="menu-text">Site Title</li>
            <li><a href="#">One</a></li>
            <li><a href="#">Two</a></li>
            <li><a href="#">Three</a></li>
        </ul></div>
        <div class="title-bar-right"><!-- Content --></div>
    </div>
</div>

Is this a bug?

 

 

Evgenia Milcheva 2 months ago

Hey,

It seems an old post and probably you have already resolved it on your own ... 
However here's for anyone else that comes upon this thread -- you're simply missing the class="sticky" next to title-bar class as stated in the documentation.

Verified and works perfectly on my side :)