为啥 semantic 使用折叠菜单无效? css 有效

2017-03-19 19:42:30 +08:00
 Flands

第一次用这个框架,好奇怪, Jquery 导入, semantic 的 css 和 js 导入,顺序正确, webstorm 文件检查正常。为啥就是用不了折叠菜单呢?样式明明都有了,点了就是没有折叠效果。实在谷歌不到了= =

<!DOCTYPE html>
<html>
<head>
    <title>The Boom!</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    <link rel="stylesheet" type="text/css" href="Semantic/dist/semantic.css">
    <script type="text/javascript" src="Semantic/jquery.js"></script>
    <script src="Semantic/dist/semantic.js"></script>
</head>
<body>
<div class="ui accordion">
    <div class="title"><i class="dropdown icon"></i> What is a dog? </div>
    <div class="content">
        <p class="transition hidden">A dog is a type of domesticated animal. </p>
    </div>
    <div class="title"><i class="dropdown icon"></i> What kinds of dogs are there? </div>
    <div class="content">
        <p>There are many breeds of dogs.</p>
    </div>
    <div class="title"><i class="dropdown icon"></i> How do you acquire a dog? </div>
    <div class="content">
        <p>Three common ways for a prospective owner to acquire a dog is from pet shops.</p>
    </div>
</div>
</body>
</html>
4292 次点击
所在节点    CSS
4 条回复
sansansine
2017-04-20 15:12:58 +08:00
遇到同样问题,楼主找到原因了吗?求赐教啊
hyperxu
2017-04-29 22:48:16 +08:00
遇到同样问题,我复选框类,折叠菜单都无效,点了没反应,各位解决了吗,同请教

@sansansine
sansansine
2017-04-30 19:36:52 +08:00
需要写一段 js,官方文档里有
kbrx93
2018-02-03 16:09:52 +08:00
$('.ui.accordion')
.accordion()
;

增加 JS 代码在 body 底部即可

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/348655

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX