0

抱歉,我无法理解 Foundation 4 JS 文档 - 如果我使用它:

$(document).foundation();

每件事都很好,但如果我使用这个:

$(document).foundation('orbit', {bullets:false});

子弹从轨道上移开,但其他 javascript 都不起作用(响应式 .toggle-topbar 或自定义表单 #customDropdown)。

我也试过这个:

$(document)
  .foundation()
  .foundation('orbit', {bullets: false});

但是所有的 JS 都可以工作,但子弹没有被移除。

我只是不确定它是如何工作的,抱歉,任何正确方向的指针都将不胜感激。

干杯

4

2 回答 2

1

您建议的答案@CMSCSS虽然对您有用,但通常并不准确,尤其是这部分:

if you initialize one plugin with options (e.g. Orbit) your have to initialize all the others you want to use or they won't run

The reason that custom styles or behaviors won't work or won't be applied is because of the order in which you initialize foundation and its components. To make everything work, your custom styles/behavior and foundation in general, you should do the customization first then initialize foundation. You can go to one of my answers and see how you can make it work. My answer was never accepted but it's a proven solution. I do it that way and it works. On a page I have an orbit, custom forms and grid layout and all work using the given technique. Hope that helps you.

于 2013-03-30T10:54:01.427 回答
0

因此发现,如果您使用选项(例如 Orbit)初始化一个插件,则必须初始化您要使用的所有其他插件,否则它们将不会像这样运行:

$(document)
  .foundation('dropdown topbar forms')
  .foundation('orbit', {bullets: false});
于 2013-03-30T05:24:51.153 回答