Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

373
Views
¿Una manera fácil de tener acceso a más de un archivo html, en una ventana electrónica?

Estoy haciendo una aplicación de escritorio usando electron. Lo que me gustaría hacer es cambiar el color de varios componentes div diferentes en mi archivo index.html, después de hacer clic en un ícono en el archivo bar.html. ¿Hay algo que pueda agregar a las preferencias web de Windows del navegador que me permita acceder fácilmente a todos los elementos dentro del archivo index.html? Por el momento, solo puedo manipular la apariencia de los componentes en mi archivo bar.html, lo cual no es bueno para lo que me gustaría lograr.

A continuación se muestra el código de mi archivo index.JS.

 ipcMain.on('state', (event, arg) => { horizontalWindow(); event.returnValue = "toggle not ready test"; }) function horizontalWindow() { sidebar = new BrowserWindow({height:80, width:2000, transparent:true, frame:false, titleBarStyle: 'none', resizable: false, webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true}}) sidebar.loadFile('bar.html') sidebar.setPosition(0, 100, true) //sidebar.setSize(1800, 80, true) sidebar.setMenuBarVisibility(false) sidebar.setAlwaysOnTop(true, 'floating') } function createWindow(){ mainWindow = new BrowserWindow({ height: 10, width: 100, frame: false,titleBarStyle: 'none', parent:mainWindow, backgroundColor: '#283243', resizable: true, webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true }}) mainWindow.setAlwaysOnTop(true, 'normal') mainWindow.setVisibleOnAllWorkspaces(true); mainWindow.loadFile('index.html') mainWindow.setMenuBarVisibility(false) mainWindow.setResizable(false) mainWindow.moveTop() mainWindow.setPosition(0,0) } app.on('ready', () => { createWindow(); }) app.on('closed', () => { win = null; }) app.on('window-all-closed', () => { app.quit(); })

Archivo Renderer.js:

 const State = document.getElementById('state') State.addEventListener('click', function(){ ipcRenderer.sendSync("State") });

¡Cualquier consejo sería muy apreciado!, ya que he estado atascado en esto por un tiempo.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!