RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-488786

Marie's questions

Martin Hope
Marie
Asked: 2023-02-25 00:27:17 +0000 UTC

单击 React 按钮后不再显示组件/即使在刷新后

  • 5

如何在 React 中制作,以便当您单击 Notification 组件中的按钮时 - 即使页面刷新也不再显示?

 {!notificationHidden &&
     (
         <Notification
             onClose={handleCalculationNotificationClose}
         >
             <Button onClick={handleCalculationNotificationClose}>
             ОК!
             </Button>
         </Notification>
     )
}

.

const [notificationHidden, setNotificationHidden] = useState(false);
const handleCalculationNotificationClose = () => {
    setNotificationHidden(true);
};
reactjs
  • 1 个回答
  • 19 Views
Martin Hope
Marie
Asked: 2023-02-17 15:28:44 +0000 UTC

如何只隐藏页面上的一个组件而不是整个页面 React

  • 6

你能告诉我如何修复代码,以便当你点击按钮时,这个功能所在的整个页面都不会被隐藏吗?

单击按钮时我只需要隐藏组件<Notification /> acomponent1并component2保留,就像它们所在的页面一样

// функции
     
     
 const [hidden, setHidden] = useState(false);
 if (hidden) return null;
     
     <Component1 />
     
     <Notification title="заголовок">
        <Text weight="400" className={styles.text}>
      Текст
        </Text>
        <div className={styles.buttonContainer} >
        <Button className={styles.notificationButton} onClick={() => setHidden(true)}>
          OK!
        </Button>
        </div>
      </Notification>
      
  <Component2 />
reactjs
  • 1 个回答
  • 12 Views
Martin Hope
Marie
Asked: 2022-08-23 01:00:33 +0000 UTC

流体布局 - 如何管理标题块

  • 2

小伙伴们,你们好!请帮助橡胶布局:

我从移动版开始(您需要为移动设备、平板电脑和桌面版制作橡胶布局) - 我为手机制作布局,但出现问题是手机的块位于布局中一个在另一个之下,如在照片图中,在平板电脑和桌面 - 连续 - 我也画了,它们上的输入变成了徽标和配置文件按钮之间。我不明白如何实现它 - 或者读什么?谢谢! 在此处输入图像描述

 <div class="header">
      <div class="header__section">
        <div class="header__item header__logo">
          <img src="img/logo.svg" alt="">
        </div>
        <div class="header__search">
          <input type="text" placeholder="Найти...">
        </div>
        <div class="header__item header__button-icon">
          <a href="#"><img src="img/profile-icon.svg" alt="profile-icon"></a>
        </div>
      </div>

    </div>

css вёрстка
  • 4 个回答
  • 56 Views
Martin Hope
Marie
Asked: 2022-08-16 22:31:18 +0000 UTC

如何做到让页面缩小时,只使用 css

  • 0

您对 info-section 部分特别感兴趣,在其他块中您不能遵循此规则:

* {
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;

}

.wrapper {
  width: 1200px;
  background-color: #c0dbd9;
  /* height: 1000px; */

}

header {
  background-color: #7faff7 ;
  /* width: 1170px; */
  height: 100px;
  margin: 0 15px;
}

.header-button {
  margin-top: 27px;
  margin-left: 30px;
  background-color: #A5C7F9;
  border: 1px solid #000000;
  border-radius: 5px;
  padding: 8px 15px;
}

.header-button-text {
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 20px;
}

.main-section {
  background-color:#b3f95a;
  display: flex;
  position: relative;
  width: 1170px;
  height: 411px;
  /* margin-top: 15px;
  margin-bottom: 15px; */
  margin: 15px;
}

.blocks {
  background-color: #8AD191;
  position: absolute;

}


.main-block-1 {
  width: 390px;
  height: 198px;
  top: 0;
  left: 0;
}

.main-block-2 {
width: 590px;
height: 198px;
left: 405px;
top: 0px;
}
.main-block-3 {
  width: 160px;
  height: 198px;
  left: 1010px;
  top: 0px;
}
.main-block-4 {
  width: 995px;
  height: 198px;
  left: 0px;
  top: 213px;
}
.main-block-5 {
  width: 160px;
  height: 198px;
  left: 1010px;
  top: 213px;
}

.info-section {
  background-color: #88B5BF;
  /* display: flex;
  position: relative; */
  /* align-items: center; */
  display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
padding: 30px;
gap: 30px;
max-width: 100%;
  /* width: 1170px; */
margin: 0 15px;
  height: 259px;
  margin-bottom: 100px;
}

.info-section > div {
  background-color: #0D89B0;
  /* position: absolute; */
  /* max-width: 100%; */
  /* width: 255px; */
  /* height: 199px; */
  /* --w: 255px; */
  /* width: var(--w); */
  aspect-ratio: 4 / 3;
  /* object-fit: contain; */
}
.footer {
  width: 1170px;
  height: 100px;
  background-color: #7FAFF7;
}
    <div class="wrapper">
      <header>
        <button class="header-button"><p class="header-button-text">Open pop-up
            button</p></button>
      </header>
      <main class="main-section">
        <div class="main-block-1 blocks"></div>
        <div class="main-block-2 blocks"></div>
        <div class="main-block-3 blocks"></div>
        <div class="main-block-4 blocks"></div>
        <div class="main-block-5 blocks"></div>
      </main>
      <div class="info-section">
        <div class="info-block-1"></div>
        <div class="info-block-2"></div>
        <div class="info-block-3"></div>
        <div class="info-block-4"></div>
      </div>
      <footer>
        <div class="footer"></div>
      </footer>
    </div>

css
  • 1 个回答
  • 37 Views
Martin Hope
Marie
Asked: 2022-08-07 23:40:04 +0000 UTC

定位 CSS 元素 (flex)

  • 0

伙计们,请帮忙。这里我有一个带有元素的块(标有复选标记的将使用 js 移动 - 非常小,循环,恒定),其他 2 个元素不会移动。但是你如何聪明地定位它们呢?当然,该方案是近似的)

我试图通过 flex 来实现,但是代码很糟糕(如果你通过顶部、左侧等编写)+ 到我需要让它适应 ipad(1024x768)的所有内容,但是当我更改所有尺寸时,一切分别移出(((

我附上了代码,但它是错误的 - 只是一个使用 left 的例子,它看起来有多丑)

我相信这个问题有一个很好的解决方案 - 请指导我,谢谢!)

.main {
  display: flex;
  /* width: 100%; */
position: relative;
}

main > img {
position: absolute
}

.main-image__fourth {
  height: 231px;
}
.main-image__first {
  width: 125px;


}
.main-image__third {
  width: 221px;
}

.main-image__fifth {
    width: 257px;
    height: 85px;
    left: -594px;
    top: 503px;
}

.main-image__sixth {
  width: 1183px;
  height: 239px;
      left: -75px;
    top: 53px;
}
 <div class="main">
             <img class="main-image__fourth" src="/src/img/4.png" alt="">
            <img class="main-image__first" src="/src/img/1.png" alt="">
            <img class="main-image__third" src="/src/img/3.png" alt="">
            <img class="main-image__fifth" src="/src/img/5.png" alt="">
            <img class="main-image__sixth" src="/src/img/6.png" alt="">
          
          </div>

css вёрстка
  • 1 个回答
  • 33 Views
Martin Hope
Marie
Asked: 2022-08-07 20:00:26 +0000 UTC

返回比传递的数字小 3 或 5 的所有数字的总和 javascript

  • 1

各位大侠,请帮我解决问题。我刚开始练习 Codewars,我不明白问题陈述中的短语(

下面是完整的条件:如果我们列出所有不超过 10 且是 3 或 5 倍数的自然数,我们得到 3、5、6 和 9。这些倍数之和为 23。完成解决方案,使其返回小于给定数的 3 或 5 的倍数的所有数的总和。此外,如果数字为负数,则返回 0(对于具有它们的语言)。笔记。如果一个数是 3 和 5 的倍数,则只数一次。

我不明白“小于转移号码”这句话 - 你是什么意思?提前感谢您的回复!

let sum = 0;

function solution(numbers) {
for (let i = 1; i <= 10; i++){
  
 if(i % 3 === 0 && i % 5 === 0) {
   console.log(i);
 }
      else if(i % 3 === 0) {
        console.log(i);
    } 
      else if (i % 5 === 0) {
        console.log(i);
    }
  else if (i < 0) {
   
  }
  }
}
javascript
  • 1 个回答
  • 10 Views

Sidebar

Stats

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

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +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