Jump to content

CEF CSS Hover & Page Transparency


ViRuZGamiing

Recommended Posts

Posted

Is there a way to make the CSS hover effect work, my HTML is fully function and can I make everything except for my <div> to be shown (it has a border radius) so without the white background being the body.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

Hover doesn't work even slowly, transparency is added.

Client

x, y = guiGetScreenSize()
browser = createBrowser(x, y, true, true, false)

addCommandHandler("lgn", function()
  loadBrowserURL(browser, "http://mta/local/login.html")
  guiSetInputEnabled(true)
  showCursor(true)
  addEventHandler("onClientRender", getRootElement(), function()
    dxDrawImage((x/2)-200, (y/2)-100, x, y, browser, 0, 0, 0, tocolor(255, 255, 255), true)
  end)
end)

Meta

<meta>
	<script src="client.lua" type="client" />

	<file src="login.html" />
	<file src="user.png" />
	<file src="lock.png" />

	<min_mta_version server="1.5.0-9.07439" />
</meta>

Login Form HTML

http://pastebin.com/nHLriSYp

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

Neither does your input or hover work because you've used CreateBrowser which the wiki states as, and highlighted the part which is your problem:

Quote

This example shows you how to create a fullscreen web browser (showing a local html file) without input-handling.

 

You're looking for input-handled functions, which can be done with GuiCreateBrowser. This would do:

local browser = guiCreateBrowser ( ( x / 2 ) - 200, ( y / 2 ) - 100, x, y, true, true, false );
local theBrowser = guiGetBrowser ( browser );
addEventHandler ( "onClientBrowserCreated", theBrowser, 
	function ()
		loadBrowserURL ( source, "http://mta/local/login.html" );
	end
);

 

Also, you know that you can position the div with css itself and create the browser with '0, 0, x, y'. right? simply add this to your body element as a class:

top: calc(50% - 100px);
left: calc(50% - 200px);
position: absolute;

 

  • Like 1

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted

Thanks didn't even realise I wasn't using guiCreateBrowser since I was looking at that page the whole time

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

guiCreateBrowser should be used for interactive websites, where people can use the website theirself. If you still want to have the dxRender for your browser then simply draw the render over the guiCreateBrowser. the browser will do the functionality while the render does the overlay of it. No idea why you would want that but oh well, you never know!

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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...