简体   繁体   中英

on $(document).foundation(); Uncaught TypeError: Cannot read property 'top' of undefined

I'm using several foundation plugins on this page. Equalizer, and Reveal. When the foundation initializer is being called it throws Uncaught TypeError: Cannot read property 'top' of undefined on the <script>$(document).foundation();</script> call.

I assume it's related to the markup being parsed associated to one of the plugins. Here's the markup...

Equalizer...

   <div class="row" data-equalizer>
                <div class="overlay large-4 large-offset-4 columns clearfix">
                   ... text
                </div>
                <div class="large-4 columns clearfix">
                ... text
                </div>
   </div>

Reveal...

<a id="terms" href="terms.php" data-reveal-id="termsModal" target="_blank" data-reveal-ajax="terms.php">Terms &amp; Conditions</a></label>

After troubleshooting a bit more, I realized the equalizer plugin was missing some markup.

I needed to add the data-equalizer-watch attribute on the child nodes.

<div class="row" data-equalizer>
   <div class="large-6 columns panel" data-equalizer-watch>
    ....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM