在下面的基本示例中,开关工作并正确地设置样式。如果我只是将foundation.css版本从5.5.2更改为6.0.5,则切换样式将丢失。为什么开关不在Foundation6.0中工作??同样,只需将样式表更改为"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>发布于 2015-12-30 20:32:40
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>https://stackoverflow.com/questions/34536710
复制相似问题