malihu自定义滚动条插件不适用于Electron.js [英] malihu custom scrollbar plugin does not work with Electron.js

查看:67
本文介绍了malihu自定义滚动条插件不适用于Electron.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为智障人士创建了一个Web应用程序.滚动条已由"malihu-custom-scrollbar插件"代替. http://manos.malihu.gr/jquery-custom-content-scroller/这在普通浏览器中可以完美运行,但现在我希望能够在没有浏览器的情况下在本地设备上使用该网站,但可以通过"Electronjs"将其作为应用程序使用.( https://electronjs.org/)除"malihu-custom-scrollbar插件"外,该方法非常有效.

I create a web application for people with intellectual disabilities. The scroll bar has been replaced by the 'malihu-custom-scrollbar plugin'. http://manos.malihu.gr/jquery-custom-content-scroller/ This works perfectly in normal browsers but now I want to be able to use the website on a local device without a browser but as an application via 'Electronjs'. (https://electronjs.org/) This works perfectly except for the 'malihu-custom-scrollbar plugin'.

在这里我找到了可能的答案: https://github.com/malihu/malihu-cus ... gin/issues/473 .但是我对Electron的了解还不够.我不知道该怎么办.在我的电子文件夹的main.js文件中,我具有以下功能可转到Malihu示例:

Here I found a possible answer: https://github.com/malihu/malihu-cus...gin/issues/473. But my knowledge of Electron does not go far enough. I don't know what to do with it. In the main.js file of my electron folder I have the following function to go to a malihu example:

function createWindow () {
  mainWindow = new BrowserWindow({
  width: 800,
  height: 600,
  frame: false, 
  webPreferences: {
  nodeIntegration: true
    }
  })

 mainWindow.loadURL('http://manos.malihu.gr/repository/custom- scrollbar/demo/examples/scrollbar_themes_demo.html')

 mainWindow.on('closed', function () {

 mainWindow = null
 })
 }

您应该看到自定义滚动条,但是只有普通的滚动条.

You should see the custom scrollbars but There are only normal scrollbars.

推荐答案

找到了解决方案:nodeIntegration:否,(是)

Found a solution: nodeIntegration: false, (was true)

mainWindow = new BrowserWindow({
    width: 800,
    height: 600,

    webPreferences: {
        nodeIntegration: false,
    }
})

这篇关于malihu自定义滚动条插件不适用于Electron.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆