定义应用程序逻辑分隔中的组件。
#酒吧 { 位置:固定; /* 固定位置以在滚动时保持在适当的位置 */ 顶部:0; 底部:0; 左:0; 宽度:3px; /* 条形的初始宽度 */ 背景色...</desc> <question vote="0"> <pre><code><html> <style> #bar { position: fixed; /* Fixed position to stay in place on scroll */ top: 0; bottom: 0; left: 0; width: 3px; /* Initial width of the bar */ background-color: #f1f1f1; /* Background of the bar */ border-right: 1px solid #d3d3d3; /* Border of the bar */ z-index: 9; } #handle { width: 100px; /* Diameter of the handle circle */ height: 100px; /* Height of the handle circle */ background-color: #2196F3; border-radius: 50%; /* Make it round */ position: absolute; /* Absolute position within the bar div */ top: 50%; /* Center it vertically */ right: -50px; /* Align to the right of the bar */ transform: translateY(-50%); /* Adjust vertical position */ cursor: pointer; /* Change cursor to indicate it's draggable */ z-index: 10; clip-path: inset(0 0 0 50%); /* Clip left half of the circle */ } </style> <body> <div id="bar"> <!-- This is the draggable handle --> <div id="handle"></div> </div> <script> // Make the handle draggable dragElement(document.getElementById("handle")); function dragElement(elmnt) { var startPosX = 0, currentPosX = 0; var maxBarWidth = window.innerWidth - (elmnt.offsetWidth /16); // Tarayıcı penceresinin genişliğini kullan , Set the maximum width for the bar. elmnt.onmousedown = dragMouseDown; function dragMouseDown(e) { e = e || window.event; e.preventDefault(); startPosX = e.clientX; document.onmouseup = closeDragElement; document.onmousemove = elementDrag; } function elementDrag(e) { e = e || window.event; e.preventDefault(); currentPosX = e.clientX - startPosX; startPosX = e.clientX; var bar = document.getElementById("bar"); var newWidth = bar.offsetWidth + currentPosX; // Define the minimum width to keep the handle from entering the bar area var minBarWidth = 3; // This is the initial width of the bar // Define the maximum width as a percentage of the window's width var maxBarWidth = window.innerWidth- elmnt.offsetWidth / 16; // Restrict the width within the minimum and maximum bounds newWidth = Math.max(minBarWidth, Math.min(newWidth, maxBarWidth)); // Set the new width bar.style.width = newWidth + "px"; // If the new width is at the minimum, keep the handle from going into the bar if(newWidth <= minBarWidth) { elmnt.style.right = "0px"; // This keeps the handle from entering the bar area } else { elmnt.style.right = "-50px"; // This is for when the handle is not at the minimum width } } function closeDragElement() { // stop moving when mouse button is released: document.onmouseup = null; document.onmousemove = null; } } </script> </body> </html> </code></pre> <p>朋友们大家好,当我最初尝试将半圆从其末端拉到左侧时,它以我不想要的方式进入酒吧并出现在那里。我实际上将 minBarWidth 设置为 3,这是条形宽度,但这仍然没有解决问题</p> <p><strong>不良情况:</strong></p> <p><a href="https://i.stack.imgur.com/kTCRg.png" target="_blank"><img src="https://cdn.txt58.com/i/AWkuc3RhY2suaW1ndXIuY29tL2tUQ1JnLnBuZw==" alt=""/></a></p> <p><strong>即使被迫向左移动也应该有效的视图:</strong><a href="https://i.stack.imgur.com/uTZIR.png" target="_blank"><img src="https://cdn.txt58.com/i/AWkuc3RhY2suaW1ndXIuY29tL3VUWklSLnBuZw==" alt=""/></a></p> </question> <answer tick="false" vote="-1"> <p>将其放入代码笔中将使您更容易理解您想要实现的目标。老实说,当你说“当我最初尝试将半圆从其末端向左拉时,它以我不想要的方式进入酒吧并出现在那里”时,我并不完全明白你在问什么。 </p> <p>但是,将 HTML 复制到测试页面,我看到了您在图像中显示的效果,但如果没有演示,它不会显示它如何跳到左侧。我解决这个问题的方法是?删除..</p> <pre><code>if(newWidth <= minBarWidth) { :: } </code></pre> <p>..并且它无需“跳到左侧”即可工作。是你想要的吗?不知道,正如我所说,很难确切地知道您在寻找什么。</p> <p>我是否还可以建议您研究一下 ES6 的改进,例如新的 let/const 关键字(而不是 var)和用于事件分配的箭头函数。</p> </answer> </body></html>
#酒吧 { 位置:固定; /* 固定位置以在滚动时保持在适当的位置 */ 顶部:0; 底部:0; 左:0; 宽度:3px; /* 条形的初始宽度 */ 背景色...</desc> <question vote="0"> <pre><code><html> <style> #bar { position: fixed; /* Fixed position to stay in place on scroll */ top: 0; bottom: 0; left: 0; width: 3px; /* Initial width of the bar */ background-color: #f1f1f1; /* Background of the bar */ border-right: 1px solid #d3d3d3; /* Border of the bar */ z-index: 9; } #handle { width: 100px; /* Diameter of the handle circle */ height: 100px; /* Height of the handle circle */ background-color: #2196F3; border-radius: 50%; /* Make it round */ position: absolute; /* Absolute position within the bar div */ top: 50%; /* Center it vertically */ right: -50px; /* Align to the right of the bar */ transform: translateY(-50%); /* Adjust vertical position */ cursor: pointer; /* Change cursor to indicate it's draggable */ z-index: 10; clip-path: inset(0 0 0 50%); /* Clip left half of the circle */ } </style> <body> <div id="bar"> <!-- This is the draggable handle --> <div id="handle"></div> </div> <script> // Make the handle draggable dragElement(document.getElementById("handle")); function dragElement(elmnt) { var startPosX = 0, currentPosX = 0; var maxBarWidth = window.innerWidth - (elmnt.offsetWidth /16); // Tarayıcı penceresinin genişliğini kullan , Set the maximum width for the bar. elmnt.onmousedown = dragMouseDown; function dragMouseDown(e) { e = e || window.event; e.preventDefault(); startPosX = e.clientX; document.onmouseup = closeDragElement; document.onmousemove = elementDrag; } function elementDrag(e) { e = e || window.event; e.preventDefault(); currentPosX = e.clientX - startPosX; startPosX = e.clientX; var bar = document.getElementById("bar"); var newWidth = bar.offsetWidth + currentPosX; // Define the minimum width to keep the handle from entering the bar area var minBarWidth = 3; // This is the initial width of the bar // Define the maximum width as a percentage of the window's width var maxBarWidth = window.innerWidth- elmnt.offsetWidth / 16; // Restrict the width within the minimum and maximum bounds newWidth = Math.max(minBarWidth, Math.min(newWidth, maxBarWidth)); // Set the new width bar.style.width = newWidth + "px"; // If the new width is at the minimum, keep the handle from going into the bar if(newWidth <= minBarWidth) { elmnt.style.right = "0px"; // This keeps the handle from entering the bar area } else { elmnt.style.right = "-50px"; // This is for when the handle is not at the minimum width } } function closeDragElement() { // stop moving when mouse button is released: document.onmouseup = null; document.onmousemove = null; } } </script> </body> </html> </code></pre> <p>朋友们大家好,当我最初尝试将半圆从其末端拉到左侧时,它以我不想要的方式进入酒吧并出现在那里。我实际上将 minBarWidth 设置为 3,这是条形宽度,但这仍然没有解决问题</p> <p><strong>不良情况:</strong></p> <p><a href="https://i.stack.imgur.com/kTCRg.png" target="_blank"><img src="https://cdn.txt58.com/i/AWkuc3RhY2suaW1ndXIuY29tL2tUQ1JnLnBuZw==" alt=""/></a></p> <p><strong>即使被迫向左移动也应该有效的视图:</strong><a href="https://i.stack.imgur.com/uTZIR.png" target="_blank"><img src="https://cdn.txt58.com/i/AWkuc3RhY2suaW1ndXIuY29tL3VUWklSLnBuZw==" alt=""/></a></p> </question> <answer tick="false" vote="0"> <p>将其放入代码笔中将使您更容易理解您想要实现的目标。老实说,当你说“当我最初尝试将半圆从其末端向左拉时,它以我不想要的方式进入酒吧并出现在那里”时,我并不完全明白你在问什么。 </p> <p>但是,将 HTML 复制到测试页面,我看到了您在图像中显示的效果,但如果没有演示,它不会显示它如何跳到左侧。我解决这个问题的方法是?删除..</p> <pre><code>if(newWidth <= minBarWidth) { :: } </code></pre> <p>..并且它无需“跳到左侧”即可工作。是你想要的吗?不知道,正如我所说,很难确切地知道您在寻找什么。</p> <p>我是否还可以建议您研究一下 ES6 的改进,例如新的 let/const 关键字(而不是 var)和用于事件分配的箭头函数。</p> </answer> </body></html>
如何在 Laravel 中同时高效地将数据从两个不同的控制器传递到同一个刀片页面? 在开发 Laravel 应用程序时,我遇到了刀片页面的问题...
我有一个博客应用程序,其中主页显示所有作者的博客文章以及博客文章的图像及其个人资料图片...但是图像没有显示,当我检查时...
所有服务都是用 Golang 编写的。我想发送 /register 请求到 auth 服务,但是当我发送 POST 请求 Kong 返回 404 (我可以发送请求到 http:localhost:9094 服务正在工作)。 我是一个...
在nodeJs中添加Joi验证,以限制endDate不超过startDate之后3年。 例子 : 开始日期 2024-03-29 , 最大结束日期应为:2027-03-29。 我试过: const maxEndDate = Joi.ref('
如何解决问题:“at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”?
我想将令牌发送回用户以重置其密码,但我收到此错误: 错误:发送电子邮件时出错,请稍后重试 在exports.forgotPassword (C:\Users\Abdure...
我需要将xml数据转换为json格式。 我使用 django 作为后端,并且我不太习惯从 xml 解析数据,所以我考虑将数据转换为 json 然后解析它。 xml
我是网络开发新手。我通过 Angular 框架构建了我的前端部分,它运行良好,我的导航没问题,我的图像和内容也很好,到引导程序等库的链接也一样。 但是...
我想让用户上传一些Excel文件,首先我尝试将它们保存在media/uploaded/int:projectid中(如果尚未创建,我想创建它)。 但是当我尝试上传它时...
我有3张原理图 预订方案、购物车方案和订单方案。购物车包含书籍列表及其数量。订单模式是 _id Cart.product._id 的数组。我如何弹出...
有没有更好的方法可以像django后端中的history.back()那样?
在 Django 中,我有“表单视图(GET)”和“操作视图(POST)” 如果操作视图中存在验证错误或任何其他错误, 我希望浏览器返回到上一个表单页面...
如何在 Spring Boot API 中启用 https 请求?
我将 Spring Boot API 配置为通过 SSL 自签名证书接收 https 请求。当我通过邮递员请求时它可以工作,但是当我们的前端应用程序(也带有 SSL 证书)ma...
部署在 Kubernetes 上时,nestjs 混合微服务的主机名应该是什么
技术堆栈 - Nestjs-2 微服务 kubernetes-AWS EKS 入口-nginx 杂交种 const app = 等待 NestFactory.create(AppModule); const 微服务 = app.connectMicroservice 技术堆栈 - Nestjs-2 微服务 kubernetes-AWS EKS 入口 - nginx 混合动力 const app = await NestFactory.create(AppModule); const microservice = app.connectMicroservice<MicroserviceOptions>( { transport: Transport.TCP, options: { host: process.env.TCP_HOST, port: parseInt(process.env.TCP_EVALUATION_PORT), }, }, { inheritAppConfig: true }, ); await app.startAllMicroservices(); await app.listen(parseInt(config.get(ConfigEnum.PORT)), '0.0.0.0'); 环境 TCP_HOST: '0.0.0.0' TCP_CORE_PORT: 8080 TCP_EVALUATION_PORT: 8080 错误 "connect ECONNREFUSED 0.0.0.0:8080" 我是否需要在 docker 中公开此端口或将其添加到安全组中的某个位置? 或者可能需要通过不同的主机? 注意:应用程序已正确部署,没有任何错误,HTTP Rest API 似乎工作正常,但 TCP @messagePattern 则不然! 谢谢 创建一个服务来匹配您要连接的实例并使用服务名称。 基本上在混合应用程序中,main.ts 配置如下 - 服务1 const app = await NestFactory.create(AppModule); const microservice = app.connectMicroservice<MicroserviceOptions>( { transport: Transport.TCP, options: { host: '0.0.0.0', port: 6200, }, }, { inheritAppConfig: true }, ); await app.startAllMicroservices(); await app.listen(6300, '0.0.0.0'); 在客户端 ClientsModule.register([ { name: 'service1', transport: Transport.TCP, options: { host: 'service1', port: 6200, }, }, ]), 现在面临同样的问题。你找到解决办法了吗?
为什么找不到 Django 管理页面和其他页面的 CSS 文件和图像?
即使在正确的文件路径中搜索,GET 方法也会在控制台中返回 404。 编辑:我发现另一篇文章说我应该在 settings.py 文件中打开调试。它成功了!...
在使用 Fragment IFC Streaming 处理 ifc.js 组件时,我在后端处理文件时遇到问题,我需要知道需要将哪些文件放入后端才能进行流式传输? `让文件流=...
TYPO3 12.4 后端登录错误LimitInternalRecursion
将网站复制到本地计算机后,登录总是失败,出现 500 错误。 PHP错误日志显示 [2024 年 4 月 2 日星期二 16:25:24.463180] [核心:错误] [pid 18408] [客户端 127.0.0.1:46504] AH0...
所以,我正在用 python 开发这个应用程序,当我尝试在浏览器中显示一些 html 时,我收到此错误: 模板不存在,位于 /xPharma/hello/ 你好.html 请求方式:GET 请求网址:...
我有一个用 C++ 编写的 TCP 服务器和一个在客户端的 React.js 应用程序。 您需要知道的是 中的 send() 方法向客户端发送一个空字符串而不是...
我开发了这个网站 - https://snotes00.vercel.app 但我在向 vercel 后端发送请求时遇到问题 - POST https://snotes00.vercel.app/server/login net::ERR_ABORTED 405 (方法不是