- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在与Electron合作,并且正在尝试制作自定义标题栏-到目前为止,我已经取得了成功。但是标题栏最重要的功能不见了-在屏幕上拖动应用程序。
我在互联网上阅读了有关-webkit-app-region: drag;
属性的信息,它起作用了!问题是...我现在无法单击标题栏中的任何按钮!
有没有办法来解决这个问题?
HTML:
<div style="position: absolute; top: 0; width: 100%; height: 29px; overflow: hidden; z-index: 50; background: rgba(255, 255, 255, 0.8);" class="titlebar">
<h1 style="float: left; opacity: 0.85; margin: 4px 0 0 44%; font-family: Jost-400-Book; font-size: 12pt;">Dashboard - Wealm</h1>
<button id="closeApp" style="font-weight: bold; opacity: 0.55; float: right; background: none; border: none; outline: none; font-family: Multicolore; font-size: 18pt; margin-top: 2px;">x</button>
<button id="minApp" style="font-weight: bold; opacity: 0.55; float: right; background: none; border: none; outline: none; font-family: Multicolore; font-size: 18pt; margin-top: 2px;">-</button>
</div>
...
const remote = require('electron').remote;
document.getElementById("minApp").addEventListener("click", function (e) {
document.getElementById('minApp').style.opacity = '0.55';
var window = remote.getCurrentWindow();
window.minimize();
});
document.getElementById("closeApp").addEventListener("click", function (e) {
document.getElementById('closeApp').style.opacity = '0.55';
var window = remote.getCurrentWindow();
window.close();
});
document.getElementById('minApp').onmouseover = function() {
document.getElementById('minApp').style.opacity = '1';
}
document.getElementById('minApp').onmouseout = function() {
document.getElementById('minApp').style.opacity = '0.55';
}
document.getElementById('closeApp').onmouseover = function() {
document.getElementById('closeApp').style.opacity = '1';
}
document.getElementById('closeApp').onmouseout = function() {
document.getElementById('closeApp').style.opacity = '0.55';
}
...
最佳答案
又是我!我设法通过更改HTML来解决此问题:
<div style="position: absolute; top: 0; width: 100%; height: 29px; overflow: hidden; z-index: 50; background: rgba(255, 255, 255, 0.8);" class="titlebar">
<div class="dragzone" style="-webkit-app-region: drag; overflow: hidden; position: absolute; left: 0; width: 990px; height: 29px;"></div>
<h1 style="float: left; opacity: 0.85; margin: 4px 0 0 44%; font-family: Jost-400-Book; font-size: 12pt;">Dashboard - Wealm</h1>
<button id="closeApp" style="font-weight: bold; opacity: 0.55; float: right; background: none; border: none; outline: none; font-family: Eight One; font-size: 18pt; margin-top: 2px;">x</button>
<button id="minApp" style="font-weight: bold; opacity: 0.55; float: right; background: none; border: none; outline: none; font-family: Eight One; font-size: 18pt; margin-top: 2px;">-</button>
</div>
-webkit-app-region: drag;
属性,该属性允许拖动窗口。
关于javascript - Electron :-webkit-app-region:拖动有效,但不允许我单击自定义标题栏中的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61174826/
我正在运行一个带有两个 HBase 0.94.7 区域服务器的小型集群。我发现区域服务器上的负载请求非常不平衡。从网络用户界面,我得到: Region1: numberOfOnlineRegions
我在 Backbone.Marionette 中有一个非常复杂(?)的布局,其中一些区域放置在 MainRegion 中。所有这些都是 CollectionView 的一部分,因此无法通过 var 直
我正在从事这样一个项目,其中应用程序执行以下操作: 用户选择一个半径(10 米到 1000 米),然后按“Go”按钮转到下一个 viewController 这里的应用程序抓取用户当前位置,并根据当前
我使用一个区域和两个 View 。我有一个 ComboBox,让用户可以选择区域中的 View 。 我有两个问题: 第一个问题是: _regionManager.Regions.Add("MyRegi
enter image description here 我正在按照MVVM模式使用WPF开发Prism Sample应用程序,但是当它通过以下代码时,它在我的应用程序中存在一些问题: var vie
根据Formatting Object documentation region-start( body 左侧的区域)跨越 之间 region-before(页眉)和 region-after(页脚)
我试图在 region-before 和 region-body 之间留出 10mm 的空间。但我无法将其与 regin-before 的大小相关联。 边界应该是这样的。使用单线“Bemerkung”
我正在伦敦地区的 AWS beanstalk 平台上部署 Spring boot 应用程序,但出现错误:- “无法实例化 [org.springframework.cloud.aws.core.reg
运行 vagrant 命令时出现如下错误, # vagrant up --provider=aws 这台机器的配置有错误。请修复以下错误并重试: AWS 提供商:* AMI 必须通过“ami”配置(
这实际上是三个不同的概念还是我混淆了? (我一直在阅读有关线程和垃圾收集的文章,但我自己也很困惑。) “关键部分” - 我认为这可能只是您不希望多个线程同时访问的代码部分的术语,即在 lock 和 M
我运行的是 Windows 10。当我从开始菜单中打开“区域和语言设置”时,我可以选择“国家或地区”。我试图在 C# 程序中获取此值。 我在丹麦。我曾尝试将我的国家/地区更改为德国(请参阅 scree
我是 javascript 新手,正在学习如何将新内容添加到现有 html 中。在下面的代码中,我尝试计算 DOM 中 li 的数量,并将总数显示到现有的 h2 元素。 我原以为结果是Region 6
我知道还有其他相同的问题,但他们没有解决我的问题。 我不断收到错误:Aws::Errors::MissingRegionError in BooksController#create, 缺少区域;使用
尝试使用 aws s3 java api 创建 AmazonS3ClientBuilder 对象并收到错误 按照这个例子: https://docs.aws.amazon.com/code-sampl
我使用 Rails 4.1 和 Postgresql(带有 PG gem)作为我的数据库。我有一个非常多的协会,从公司到省,有一个称为区域的连接表。现在显然区域表没有主键,因为我使用了 { :id =
我是一名优秀的程序员,十分优秀!