V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Flands
V2EX  ›  CSS

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

  •  
  •   Flands · Mar 19, 2017 · 4937 views
    This topic created in 3325 days ago, the information mentioned may be changed or developed.

    第一次用这个框架,好奇怪, 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>
    
    4 replies    2018-02-03 16:09:52 +08:00
    sansansine
        1
    sansansine  
       Apr 20, 2017
    遇到同样问题,楼主找到原因了吗?求赐教啊
    hyperxu
        2
    hyperxu  
       Apr 29, 2017
    遇到同样问题,我复选框类,折叠菜单都无效,点了没反应,各位解决了吗,同请教

    @sansansine
    sansansine
        3
    sansansine  
       Apr 30, 2017 via Android   ❤️ 1
    需要写一段 js,官方文档里有
    kbrx93
        4
    kbrx93  
       Feb 3, 2018
    $('.ui.accordion')
    .accordion()
    ;

    增加 JS 代码在 body 底部即可
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5703 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 07:47 · PVG 15:47 · LAX 00:47 · JFK 03:47
    ♥ Do have faith in what you're doing.