RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

全部问题

Martin Hope
Владислав
Asked: 2024-12-20 04:02:51 +0000 UTC

为什么NA​​SM中需要AL寄存器?

  • 5

为什么需要 AL 寄存器以及其中存储了什么?

ассемблер
  • 1 个回答
  • 32 Views
Martin Hope
eccs0103
Asked: 2024-12-20 01:56:37 +0000 UTC

滑动选择列表

  • 5

描述

我正在尝试制作一个选择性列表,当您单击其中的某个元素时,它应该平滑地移动到中心。我正在尝试使用溢出和滚动条来实现这一点。

const divScrollPicker = document.querySelector(`div#scroll-picker`);
divScrollPicker?.querySelectorAll(`button`).forEach((button, index) => {
    button.addEventListener(`click`, event => button.scrollIntoView({ behavior: `smooth`, block: `center` }));
});
body {
  position: fixed;
  inset: 0;
  max-width: 100vmin;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: auto;
  align-content: center;
}

div#scroll-picker {
  display: flex;
  flex-direction: column;
  max-height: 30px;
  overflow-y: visible;
  scroll-snap-type: y mandatory;
  scroll-snap-align: center;
  scroll-padding: 0;

  &>* {
    min-height: 100%;
    max-height: 100%;
  }
}

div#scroll-picker,
div#picker-container {
  border: 1px solid black;
}
<div id="scroll-picker">
  <button type="button" title>Button 1</button>
  <button type="button" title>Button 2</button>
  <button type="button" title>Button 3</button>
  <button type="button" title>Button 4</button>
  <button type="button" title>Button 5</button>
  <button type="button" title>Button 6</button>
  <button type="button" title>Button 7</button>
  <button type="button" title>Button 8</button>
</div>
<div id="picker-container"></div>

问题

  1. 为了让元素滑动,我必须启用滑块,即overflow: scroll或auto。
  2. 如果我启用滑块,则不会显示块之外的元素。
  3. 如果块外的元素未显示,我无法单击它们以使它们滑动到中心。

我仍然找不到摆脱这个恶性循环的方法。

问题

你有解决办法吗?
或者你能建议另一种方式吗?

html
  • 1 个回答
  • 43 Views
Martin Hope
iskeym
Asked: 2024-12-20 01:20:16 +0000 UTC

TelegramBadRequest:电报服务器说 - 错误请求:文件太大

  • 6

我正在尝试通过 aiogram 下载发送的视频

videos = message.video
text = message.caption
print(text)
file_id = videos.file_id
file_path = await bot.get_file(file_id)
await bot.download_file(file_path.file_path, f'path/to/save/{file_id}.mp4')

我收到一个错误

aiogram.exceptions.TelegramBadRequest:电报服务器说 - 错误请求:文件太大

有什么办法可以下载大文件吗?感谢您的帮助

python
  • 1 个回答
  • 23 Views
Martin Hope
TopTTeDHbIu-DeJLbFuH4uk
Asked: 2024-12-19 22:10:18 +0000 UTC

无法将元素定位在页面的中心和末尾

  • 4

大家好。如何定位屏幕截图中所示的元素?请注意,使用绝对定位或translateX() 函数不会产生所需的结果。页眉应该是橡胶的,也就是说,缩放时,文本会收缩到页面的左侧。当使用上述方法时,遗憾的是,结果是否定的。在此输入图像描述

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iRobot</title>
    <link href="https://fonts.googleapis.com/css2?family=PT+Sans&display=swap" rel="stylesheet">
    <!-- STYLES -->
    <link rel="stylesheet" href="styles/main.css">
    <link rel="stylesheet" href="styles/colors.css">
    <link rel="stylesheet" href="styles/header.css">
</head>
<body>
<div class="header-container">
<!--    <div class="header">-->
        <div class="header-carousel">
            <div class="carousel-item">Order by 12/19/24 at 11:59 PM EST for 2-day shipping on all robot orders for
                delivery
                by 12/24/24.
                <a href="https://www.irobot.com/en_US/deals.html" target="_blank">Select preferred shipping option at
                    checkout.</a></div>
            <div class="carousel-item carousel-item-hidden">New Markdown: 45% off the Roomba Combo® i5+ Self-Emptying
                Robot
                Vacuum and Mop. <a href="https://www.irobot.com/en_US/roomba-combo-i5-series-robot-vacuum-and-mop/Roomba-Combo-i5-Series-Robots.html">Shop Deal</a>
            </div>
        </div>
        <div class="header-link">
            <a href="https://homesupport.irobot.com/s/">Support</a>
            <a href="https://www.irobot.com/en_US/login">Order Status</a>
            <a href="https://www.irobot.com/en_US/login">Login</a>
            <span class="header-language">English (United States)</span>
        </div>
<!--    </div>-->
</div>

<script src="scripts/header.js"></script>
</body>
</html>

CSS:

.header-container {
    display: flex;
    /*justify-content: space-between;*/
    justify-content: center;
    align-items: center;
    height: 2.5rem;
    background-color: var(--background-header);
}

.header {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.header-carousel {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    width: clamp(100px, 100%, 500px);
}

.carousel-item {
    text-align: center;
}

.carousel-item-hidden {
    display: none;
}
html
  • 1 个回答
  • 39 Views
Martin Hope
alexWithoutBeard
Asked: 2024-12-19 20:09:50 +0000 UTC

如何从表中获取列并限制其中激活单元格的数量

  • 5

有必要确保一列中不能激活超过五个单元格。我试图从列中获取 td.active 的数量,但出现了一些奇怪的情况)

let table = document.querySelector("table");

table.addEventListener("click", ({ target }) => {
  if (target.tagName == "TD") {
    let trs = document.querySelectorAll("tr");
    for (let tr of trs) {
      let cols = tr.querySelectorAll("td.active");
      console.log(cols.length)
      if (cols.length <= 5) {
        target.classList.add("active");
      }
      else target.classList.remove('active')
    }
  }
});
 table {
    width: 500px;
    height: 500px;
    margin-bottom: 20px;
    /* border: 1px solid black; */
    /* border-collapse: collapse;  */
  }
  table tr {
    font-weight: bold;
    padding: 5px;
    border: 1px
 solid black;
  }
  table td {
    border: 1px solid black;
    padding: 5px;
    height: 40px;
    width: 40px;

  }
: 5px;
    border: 
  .active{
    background-color: aqua;
    pointer-events: none;

  }
  .diactive{
    pointer-events: none;
  } 
<table>
      <tr>
        <td data-col="0"></td>
        <td data-col="1"></td>
        <td data-col="2"></td>
        <td data-col="3"></td>
        <td data-col="4"></td>
        <td data-col="5"></td>
      </tr>
      <tr>
        <td data-col="6"></td>
        <td data-col="7"></td>
        <td data-col="8"></td>
        <td data-col="9"></td>
        <td data-col="10"></td>
        <td data-col="11"></td>
      </tr>
      <tr>
        <td data-col="12"></td>
        <td data-col="13"></td>
        <td data-col="14"></td>
        <td data-col="15"></td>
        <td data-col="16"></td>
        <td data-col="17"></td>
      </tr>
      <tr>
        <td data-col="18"></td>
        <td data-col="19"></td>
        <td data-col="20"></td>
        <td data-col="21"></td>
        <td data-col="22"></td>
        <td data-col="23"></td>
      </tr>
      <tr>
        <td data-col="24"></td>
        <td data-col="25"></td>
        <td data-col="26"></td>
        <td data-col="27"></td>
        <td data-col="28"></td>
        <td data-col="29"></td>
      </tr>
      <tr>
        <td data-col="30"></td>
        <td data-col="31"></td>
        <td data-col="32"></td>
        <td data-col="33"></td>
        <td data-col="34"></td>
        <td data-col="35"></td>v
      </tr>
      
    </table>

javascript
  • 1 个回答
  • 24 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