Foundation 6 开关不起作用?

Foundation 6 switches don't work?

在以下非常基本的示例中,开关可以正常工作并且样式正确。如果我只是将 foundation.css 版本从 5.5.2 更改为 6.0.5,切换样式就会丢失。为什么开关在 Foundation 6.0 中不起作用???同样,只需将样式 sheet 更改为“https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.5/css/foundation.css”,它就会停止工作。

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Foundation Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.css">

  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.5/js/foundation.min.js"></script></head>
<body>

<div style="padding:20px;">
  <div class="switch large">
    <input id="mySwitch1" type="checkbox">
    <label for="mySwitch1"></label>
  </div> 
</div>

</body>
</html>

Foundation 在 6.0 版中略微更改了其命名方案,因此您需要更新 HTML 以匹配它。请参阅此处的文档:

http://foundation.zurb.com/sites/docs/switch.html

    <div class="switch large">
        <input class="switch-input" id="largeSwitch" type="checkbox" name="exampleSwitch">
        <label class="switch-paddle" for="largeSwitch">
            <span class="show-for-sr">Show Large Elephants</span>
        </label>
    </div>