澳门银河网上官方赌场_老品牌值得信赖

ITKeyword,专注技术干货聚合推荐

注册 | 登录

javascript - How to deal with $(document).foundation() call and WebPack?

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
地址https://www.aliyun.com/minisite/goods

up vote 4 down vote favorite According to the Foundation's documentation: After you have included the Foundation JavaScript, just add a simple call to initialize all plugins on your page. We recommend that you initialize Foundation at the end of the page . <script>

$(document).foundation();

</script>

My app uses WebPack and therefore modules loads are async. It means that the classical script at the bottom of the body runs BEFORE a ui-view is populated with a template. (using Angular). If I put the script at the bottom, the DOM is populated before being parsed by Foundation's scripts, resulting in no effect at all of Foundation's components's behaviour. Have you experienced the same? I don't want to trigger $(document).foundation(); in each controller's template. javascript angularjs angular-ui-router zurb-foundation webpack
  |
  this question asked Jan 26 '16 at 13:20 Mik378 13.8k 11 45 107      stackoverflow.com/a/17367185/985949 I tried this and it works, but is there a better solution? –  Mik378 Jan 26 '16 at 13:32



 |  1 Answers

up vote 0 down vote You should execute $(document).foundation() on document.ready event or window.load. But the best solution is to module wise initiate the Foundation JS. For example, creating an accordion var elem = new Foundation.Accordion(element, options);
  |
  this answer answered Nov 4 '16 at 10:06 Jeffrey de Graaf 437 3 15



 | 

up vote 4 down vote favorite According to the Foundation's documentation: After you have included the Foundation JavaScript, just add a simple call to initialize all plugins on you

相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。

澳门银河网上官方赌场 <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>