Однако jquery, похоже, не работает должным образом, и анимация не выполняется.
Пример следующий: https://www.w3schools .com/jquery/tryit.asp?filename=tryjquery_animation1
main.js
Код: Выделить всё
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
Код: Выделить всё
Hello World!
window.$ = window.jQuery = require('https://code.jquery.com/jquery-3.3.1.slim.min.js');
$(document).ready(function(){
$("button").click(function(){
$("div").animate({left: '250px'});
});
});
Start Animation
// You can also require other files to run in this process
require('./renderer.js')
Подробнее здесь: https://stackoverflow.com/questions/635 ... -framework
Мобильная версия