Can you use CSS with Gmod's DHTML, and how do I send Lua code via Javascript?
1 replies, posted
I am an absolute beginner at Lua, but I got pretty good experience with web development. I've done research, and this is what I got so far.
[QUOTE]
local html = vgui.Create("DHTML")
frame:SetPos(0,0)
frame:SetSize(ScrW(),ScrH())
frame:SetBackgroundColor(loadingBackground)
html:SetHTML( [[
<p onclick="self:Remove()">Click me!</p>
]])
frame:MakePopup()
[/QUOTE]
I know the onclick is used completely wrong, but I want it to activate the Panel:Remove() function on itself. Also I can't seem to find anything relating to CSS (Cascading Style Sheets) on Google.
Any help would be well appriciated. Thanks! :D
Eh, for CSS just use <style> tags in HTML itself. For JS-Lua interop look here: [URL="http://wiki.garrysmod.com/page/DHTML/AddFunction"]http://wiki.garrysmod.com/page/DHTML/AddFunction[/URL], it even has an example.
Sorry, you need to Log In to post a reply to this thread.