RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 891331
Accepted
Master Wenom
Master Wenom
Asked:2020-10-10 19:37:07 +0000 UTC2020-10-10 19:37:07 +0000 UTC 2020-10-10 19:37:07 +0000 UTC

如何以具有复杂形状段的圆形布局菜单?

  • 772

我不是 and 方面的专业人士CSS,JS但在这里您需要解决以下问题: 圆形菜单

对左边的元素感兴趣。我在片段中没有找到类似的东西(可能类似的元素以某种方式被某个名称调用)。
它应该是这样工作的:当您单击一个扇区时,它的大小会增加(如数字 1 所示),并且在右侧,信息会发生变化。
也许某处有类似的实现?

javascript
  • 1 1 个回答
  • 10 Views

1 个回答

  • Voted
  1. Best Answer
    Никита Фаст
    2020-10-12T07:35:22Z2020-10-12T07:35:22Z

    虽然第一部分

    在这里训练

        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 396">
        <g class="red">
            <path d="M 65.575894,283.98177 183.65971,154.16217 155.57143,72.378151 C 58.782665,95.809208 10.190442,191.8428 65.575894,283.98177 Z"
               style="fill:red;" />
            <text
               xml:space="preserve"
               style="font-size:44.77183914px;line-height:41.97360229px;font-family:Lato;fill:#ffffff;"
               x="46.749924"
               y="291.71173"
               id="text4522"
               transform="scale(1.2137117,0.8239189)"><tspan
                 id="tspan4520"
                 x="46.749924"
                 y="291.71173"
                 style="fill:#ffffff;fill-opacity:1;stroke-width:1.67894411">3</tspan></text>
            <text
               xml:space="preserve"
               style="font-size:20.5846405px;line-height:11.40928841px;font-family:Lato;fill:#ffffff;"
               x="100.70348"
               y="100.92748"
               id="text4534"
               transform="scale(0.79472758,1.2582928)"><tspan
                 id="tspan4532"
                 x="100.70348"
                 y="100.92748"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408">Lorem Ipsum </tspan><tspan
                 x="100.70348"
                 y="115.30096"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4536">is simply dummy</tspan><tspan
                 x="100.70348"
                 y="129.67444"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4538"> text of the printing </tspan><tspan
                 x="100.70348"
                 y="144.04791"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4540">and typesetting</tspan><tspan
                 x="100.70348"
                 y="158.42139"
                 style="line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4542"><tspan
           style="font-size:10.86598873px;fill:#ffffff;stroke-width:0.77192408"
           id="tspan4544"> industry</tspan>.</tspan></text>
          </g>
          
           <g class="green">
            <path
               style="fill:green;"
               d="M 293.67227,256.41544 122.37935,218.97533 65.575894,283.98177 c 68.557676,72.00645 175.940786,66.19474 228.096376,-27.56633 z" />
            <text
               xml:space="preserve"
               style="font-size:44.77183914px;line-height:41.97360229px;font-family:Lato;fill:#ffffff;"
               x="191.37885"
               y="345.22723"
               id="text4530"
               transform="scale(1.2137117,0.8239189)"><tspan
                 id="tspan4528"
                 x="191.37885"
                 y="345.22723"
                 style="fill:#ffffff;fill-opacity:1;stroke-width:1.67894411">2</tspan></text>
            <text
               transform="scale(1.0701775,0.93442444)"
               id="text4568"
               y="272.83636"
               x="105.10145"
               style="font-size:22.53310585px;line-height:12.48924828px;font-family:Lato;fill:#ffffff;"
               xml:space="preserve"><tspan
                 style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
                 y="272.83636"
                 x="105.10145"
                 id="tspan4556">Lorem Ipsum </tspan><tspan
                 id="tspan4558"
                 style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
                 y="288.57037"
                 x="105.10145">is simply dummy</tspan><tspan
                 id="tspan4560"
                 style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
                 y="304.30438"
                 x="105.10145"> text of the printing </tspan><tspan
                 id="tspan4562"
                 style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
                 y="320.03842"
                 x="105.10145">and typesetting</tspan><tspan
                 id="tspan4566"
                 style="line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
                 y="335.77243"
                 x="105.10145"><tspan
           id="tspan4564"
           style="font-size:11.89452267px;fill:#ffffff;stroke-width:0.84499151"> industry</tspan>.</tspan></text>
          </g>
          
          <g class="blue">
            <path
               style="fill:blue;"
               d="m 155.57143,72.378151 53.2437,167.218489 84.85714,16.63865 C 321.85558,160.72205 263.06041,70.57337 155.57143,72.378151 Z" />
            <text
               transform="scale(1.2137117,0.8239189)"
               id="text4526"
               y="143.28191"
               x="146.82492"
               style="font-size:44.77183914px;line-height:41.97360229px;font-family:Lato;fill:#ffffff;"
               xml:space="preserve"><tspan
                 style="fill:#ffffff;fill-opacity:1;stroke-width:1.67894411"
                 y="143.28191"
                 x="146.82492"
                 id="tspan4524">1</tspan></text>
            <text
               xml:space="preserve"
               style="font-size:20.5846405px;line-height:11.40928841px;font-family:Lato;fill:#ffffff;"
               x="251.44484"
               y="106.87792"
               id="text4582"
               transform="scale(0.79472758,1.2582928)"><tspan
                 id="tspan4570"
                 x="251.44484"
                 y="106.87792"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408">Lorem Ipsum </tspan><tspan
                 x="251.44484"
                 y="121.2514"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4572">is simply dummy</tspan><tspan
                 x="251.44484"
                 y="135.62488"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4574"> text of the printing </tspan><tspan
                 x="251.44484"
                 y="149.99835"
                 style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4576">and typesetting</tspan><tspan
                 x="251.44484"
                 y="164.37183"
                 style="line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
                 id="tspan4580"><tspan
           style="font-size:10.86598873px;fill:#ffffff;stroke-width:0.77192408"
           id="tspan4578"> industry</tspan>.</tspan></text>
          </g>
        </svg>

    第二部分是最后一个带有工作选项卡的部分(单击外部关闭所有选项卡)

    $("g.red").on("click", function() {
      $(this).css({
        "transform": "scale(1.1)translate(-40px,-30px)"
      });
      $(".blue,.green").removeAttr("style");
      $(".info1").show();
      $(".info2,.info3").hide();
    });
    
    $("g.blue").on("click", function() {
      $(this).css({
        "transform": "scale(1.1)translate(10px,-30px)"
      });
      $(".red,.green").removeAttr("style");
      $(".info2").show();
      $(".info1,.info3").hide();
    });
    
    $("g.green").on("click", function() {
      $(this).css({
        "transform": "scale(1.1)translate(10px,5px)"
      });
      $(".blue,.red").removeAttr("style");
      $(".info3").show();
      $(".info1,.info2").hide();
    });
    
    jQuery(function($) {
      $(document).mouseup(function(e) {
        var el = $("g");
        if (!el.is(e.target) &&
          el.has(e.target).length === 0) {
          el.removeAttr("style");
          $(".info").hide();
    
        }
      });
    });
    svg {
      width: 450px;
      transform: translateY(-40px);
    }
    
    .items {
      width: 300px;
      height: 300px;
      overflow: hidden;
    }
    
    .wrapper {
      display: flex;
    }
    
    .info1,
    .info2,
    .info3 {
      display: none;
      background: inherit;
    }
    <div class="wrapper">
      <div class="items">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 420">
    <g class="red">
        <path d="M 65.575894,283.98177 183.65971,154.16217 155.57143,72.378151 C 58.782665,95.809208 10.190442,191.8428 65.575894,283.98177 Z"
           style="fill:red;" />
        <text
           xml:space="preserve"
           style="font-size:44.77183914px;line-height:41.97360229px;font-family:Lato;fill:#ffffff;"
           x="46.749924"
           y="291.71173"
           id="text4522"
           transform="scale(1.2137117,0.8239189)"><tspan
             id="tspan4520"
             x="46.749924"
             y="291.71173"
             style="fill:#ffffff;fill-opacity:1;stroke-width:1.67894411">3</tspan></text>
        <text
           xml:space="preserve"
           style="font-size:20.5846405px;line-height:11.40928841px;font-family:Lato;fill:#ffffff;"
           x="100.70348"
           y="100.92748"
           id="text4534"
           transform="scale(0.79472758,1.2582928)"><tspan
             id="tspan4532"
             x="100.70348"
             y="100.92748"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408">Lorem Ipsum </tspan><tspan
             x="100.70348"
             y="115.30096"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4536">is simply dummy</tspan><tspan
             x="100.70348"
             y="129.67444"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4538"> text of the printing </tspan><tspan
             x="100.70348"
             y="144.04791"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4540">and typesetting</tspan><tspan
             x="100.70348"
             y="158.42139"
             style="line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4542"><tspan
       style="font-size:10.86598873px;fill:#ffffff;stroke-width:0.77192408"
       id="tspan4544"> industry</tspan>.</tspan></text>
      </g>
      
       <g class="green">
        <path
           style="fill:green;"
           d="M 293.67227,256.41544 122.37935,218.97533 65.575894,283.98177 c 68.557676,72.00645 175.940786,66.19474 228.096376,-27.56633 z" />
        <text
           xml:space="preserve"
           style="font-size:44.77183914px;line-height:41.97360229px;font-family:Lato;fill:#ffffff;"
           x="191.37885"
           y="345.22723"
           id="text4530"
           transform="scale(1.2137117,0.8239189)"><tspan
             id="tspan4528"
             x="191.37885"
             y="345.22723"
             style="fill:#ffffff;fill-opacity:1;stroke-width:1.67894411">2</tspan></text>
        <text
           transform="scale(1.0701775,0.93442444)"
           id="text4568"
           y="272.83636"
           x="105.10145"
           style="font-size:22.53310585px;line-height:12.48924828px;font-family:Lato;fill:#ffffff;"
           xml:space="preserve"><tspan
             style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
             y="272.83636"
             x="105.10145"
             id="tspan4556">Lorem Ipsum </tspan><tspan
             id="tspan4558"
             style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
             y="288.57037"
             x="105.10145">is simply dummy</tspan><tspan
             id="tspan4560"
             style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
             y="304.30438"
             x="105.10145"> text of the printing </tspan><tspan
             id="tspan4562"
             style="font-size:11.89452267px;line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
             y="320.03842"
             x="105.10145">and typesetting</tspan><tspan
             id="tspan4566"
             style="line-height:12.48924828px;fill:#ffffff;stroke-width:0.84499151"
             y="335.77243"
             x="105.10145"><tspan
       id="tspan4564"
       style="font-size:11.89452267px;fill:#ffffff;stroke-width:0.84499151"> industry</tspan>.</tspan></text>
      </g>
      
      <g class="blue">
        <path
           style="fill:blue;"
           d="m 155.57143,72.378151 53.2437,167.218489 84.85714,16.63865 C 321.85558,160.72205 263.06041,70.57337 155.57143,72.378151 Z" />
        <text
           transform="scale(1.2137117,0.8239189)"
           id="text4526"
           y="143.28191"
           x="146.82492"
           style="font-size:44.77183914px;line-height:41.97360229px;font-family:Lato;fill:#ffffff;"
           xml:space="preserve"><tspan
             style="fill:#ffffff;fill-opacity:1;stroke-width:1.67894411"
             y="143.28191"
             x="146.82492"
             id="tspan4524">1</tspan></text>
        <text
           xml:space="preserve"
           style="font-size:20.5846405px;line-height:11.40928841px;font-family:Lato;fill:#ffffff;"
           x="251.44484"
           y="106.87792"
           id="text4582"
           transform="scale(0.79472758,1.2582928)"><tspan
             id="tspan4570"
             x="251.44484"
             y="106.87792"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408">Lorem Ipsum </tspan><tspan
             x="251.44484"
             y="121.2514"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4572">is simply dummy</tspan><tspan
             x="251.44484"
             y="135.62488"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4574"> text of the printing </tspan><tspan
             x="251.44484"
             y="149.99835"
             style="font-size:10.86598873px;line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4576">and typesetting</tspan><tspan
             x="251.44484"
             y="164.37183"
             style="line-height:11.40928841px;fill:#ffffff;stroke-width:0.77192408"
             id="tspan4580"><tspan
       style="font-size:10.86598873px;fill:#ffffff;stroke-width:0.77192408"
       id="tspan4578"> industry</tspan>.</tspan></text>
      </g>
    </svg>
    
      </div>
      <div class="informers">
        <div class="info info1">
          text1 text1 text1 text1 text1
        </div>
        <div class="info info2">
          text2 text2 text2 text2 text2 text2
        </div>
        <div class="info info3">
          text3 text3 text3 text3 text3 text3 text3
        </div>
      </div>
    </div>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

    由于我不会写js,所以我是这样写的

    结果已经准备好了,如果stackoverflow public 有助于缩短js,它通常会超级

    • 4

相关问题

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    是否可以在 C++ 中继承类 <---> 结构?

    • 2 个回答
  • Marko Smith

    这种神经网络架构适合文本分类吗?

    • 1 个回答
  • Marko Smith

    为什么分配的工作方式不同?

    • 3 个回答
  • Marko Smith

    控制台中的光标坐标

    • 1 个回答
  • Marko Smith

    如何在 C++ 中删除类的实例?

    • 4 个回答
  • Marko Smith

    点是否属于线段的问题

    • 2 个回答
  • Marko Smith

    json结构错误

    • 1 个回答
  • Marko Smith

    ServiceWorker 中的“获取”事件

    • 1 个回答
  • Marko Smith

    c ++控制台应用程序exe文件[重复]

    • 1 个回答
  • Marko Smith

    按多列从sql表中选择

    • 1 个回答
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Suvitruf - Andrei Apanasik 什么是空? 2020-08-21 01:48:09 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5