Jump to content

How i can control scroolbar in CEF browser?


Kamycz3q

Recommended Posts

Screenshoot: https://imgur.com/a/YsMHxw0

Code:

function pokazgui()
        --In order to render the browser on the full screen, we need to know the dimensions.
    local screenWidthscreenHeight = guiGetScreenSize()
 
    --Let's create a new browser in local mode. We will not be able to load an external URL.
    local webBrowser = createBrowser(screenWidthscreenHeighttruetrue)
        
    --This is the function to render the browser.
    function webBrowserRender()
        --Render the browser on the full size of the screen.
        dxDrawImage(screenWidth/4screenHeight/4screenWidth/2screenHeight/2webBrowser000tocolor(255,255,255,255), true)
    end
 
    --The event onClientBrowserCreated will be triggered, after the browser has been initialized.
    --After this event has been triggered, we will be able to load our URL and start drawing.
    addEventHandler("onClientBrowserCreated"webBrowser
        function()
            --After the browser has been initialized, we can load our file.
            loadBrowserURL(webBrowser"http://mta/local/html/index.html")
            --Now we can start to render the browser.
            addEventHandler("onClientRender"rootwebBrowserRender)
            showCursor(true)
        end
    )
 
end
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...