久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

電子標題欄“無拖動"和“拖動"不工作

Electron title bar quot;no-dragquot; and quot;dragquot; not working(電子標題欄“無拖動和“拖動不工作)
本文介紹了電子標題欄“無拖動"和“拖動"不工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 #topleft 紅色標題欄,其中包含多個標簽".應該填滿所有可用空間的按鈕除了一個#topright藍色塊.
借助 -webkit-app-region: drag;,可以通過在 #topleft 的紅色背景上單擊并拖動來移動主 Electron 窗口.這行得通.

I have a #topleft red title bar containing multiple "tab" buttons that should fill all the available space except a #topright blue block.
It is possible to move the main Electron window by click-and-dragging on #topleft's red background, thanks to -webkit-app-region: drag;. This works.

問題:

  1. #topright 上的點擊被忽略:alert() 未被觸發(此塊的子元素同樣存在問題)
  2. #topright span:hover { background-color: black;} 被忽略
  3. #topright { -webkit-app-region: no-drag;} 被忽略:我們仍然可以通過點擊并拖動 #topright 來移動窗口,而它不應該
  1. clicks on #topright are ignored: alert() is not triggered (same problem for child elements of this block)
  2. #topright span:hover { background-color: black; } is ignored
  3. #topright { -webkit-app-region: no-drag; } is ignored: we can still move the window by click-and-dragging on #topright whereas it should not

但是,如果我們在瀏覽器中運行相同的 HTML 代碼,則一切正常.

However if we run the same HTML code in a browser, all is working correctly.

如何在 Electron 中解決這個問題?

for (var i = 0; i < 50; i++)
document.getElementById("topleft").innerHTML += "<button>xyz" + i + "</button>";

* { margin: 0; }
#topright { float: right; width: 100px; background-color: blue; -webkit-app-region: no-drag; }
#topright:hover { background-color: black; }
#topleft { background-color: red; -webkit-app-region: drag; padding: 10px; }

<div id="topright" onclick="alert();">Click here!</div>
<div id="topleft"></div>

注意:

  • 我已經看到了我已經看到了無框窗口在電子(Windows)中使用控件,但在這里沒有幫助.

鏈接的問題

推薦答案

我對 Electron 不熟悉,但你可以嘗試在紅色元素中移動浮動的藍色元素.

I'm not familiar with Electron but you could try moving the floated blue element within the red element.

const max = 50;
let   i   = 0;

for ( ; i < max; i++ ) {
  document.getElementById( 'topleft' ).innerHTML += `<button>xyz${ i }</button>`;
}

* {
  margin: 0;
}

#topleft {
  background-color: red;
  -webkit-app-region: drag;
  padding: 10px;
}

#topright {
  float: right;
  margin: -10px -10px 0 0;
  width: 100px;
  background-color: blue;
  -webkit-app-region: no-drag;
}

#topright:hover {
  background-color: black;
}

<div id="topleft">
  <div id="topright" onclick="alert();">Click here!</div>
</div>

注意:我添加了一些負邊距,以便藍色元素與紅色元素的邊緣對接(而不是由于填充而位于紅色元素內).

Note: I added some negative margins so that the blue element would butt up against the edges of the red element (vs being inside the red element because of padding).

使用絕對定位和克隆"的原始答案元素.由于新信息而更新了答案.

Original Answer using absolute positioning and a "cloned" element. Updated answer due to new information.

這篇關于電子標題欄“無拖動"和“拖動"不工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器進程中創建子窗口時如何修復 BrowserWindow 不是構造函數錯誤) - IT屋-程序員軟件開發技術
mainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 應用程序上顯示白屏)
Electron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:無法在第二個 loadURL 上執行腳本)
how to use electron browser window inside components in angular-cli?(如何在angular-cli的組件內使用電子瀏覽器窗口?)
ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之間共享 redux 存儲?)
How to access camera/webcamera inside electron app?(如何在電子應用程序中訪問相機/網絡攝像頭?)
主站蜘蛛池模板: 成人精品一区二区 | 午夜欧美一区二区三区在线播放 | 玖玖综合网| 国产精品久久久久久妇女6080 | 一区二区精品 | 久久精品成人 | 9191在线观看 | 亚洲一区在线日韩在线深爱 | 91亚洲国产 | 国产精品国产成人国产三级 | 免费黄色录像视频 | 亚洲一区久久 | 九九热国产精品视频 | 国产一区二区影院 | 日韩欧美在线播放 | 人人做人人澡人人爽欧美 | 欧美综合国产精品久久丁香 | 久久不射电影网 | av一区在线观看 | 一区二区三区在线 | 91精品国产一区二区三区 | 日韩欧美专区 | 国产日韩欧美一区 | 亚洲视频观看 | 国产精品国产三级国产aⅴ原创 | 天天久久 | 一级黄在线观看 | 色综合视频 | 国产精品日韩欧美一区二区三区 | www.色综合| 国产一区二区三区四区 | 精品一区二区视频 | www.久草| 欧美一区2区三区4区公司 | 一区二区三区免费在线观看 | 日韩有码一区 | 一级片在线视频 | 九九热在线精品视频 | 男女羞羞在线观看 | 日韩精品免费一区二区在线观看 | 国产一区二区三区视频 |