xXMADEXx Posted January 27, 2013 Posted January 27, 2013 Hey guys, I tried making it, so that when you hover over an image, it adjusts the alpha, and when you're cursor leave the image, i puts the alpha back to 255 -- Alpha Functions -- -- Dim on hover addEventHandler( "onClientMouseEnter", rog_ucp_main_img_sms, function () setElementAlpha(rog_ucp_main_img_sms,100) end ) addEventHandler( "onClientMouseEnter", rog_ucp_main, function () setElementAlpha(rog_ucp_main,100) end ) -- Back when leave addEventHandler("onClientMouseLeave",rog_ucp_main, function () setElementAlpha(rog_ucp_main,255) end ) addEventHandler("onClientMouseLeave",rog_ucp_main_img_sms, function () setElementAlpha(rog_ucp_main_img_sms,255) end )
xXMADEXx Posted January 27, 2013 Author Posted January 27, 2013 just use source not the element name Okey, i did that. It still dosn't work, this is the result i got: -- Alpha Functions -- -- Dim on hover addEventHandler( "onClientMouseEnter", rog_ucp_main_img_sms, function () setElementAlpha(source,100) end ) addEventHandler( "onClientMouseEnter", rog_ucp_main, function () setElementAlpha(source,100) end ) -- Back when leave addEventHandler("onClientMouseLeave",rog_ucp_main, function () setElementAlpha(source,255) end ) addEventHandler("onClientMouseLeave",rog_ucp_main_img_sms, function () setElementAlpha(source,255) end )
Blaawee Posted January 27, 2013 Posted January 27, 2013 -- Dim on hover addEventHandler( "onClientMouseEnter", root, function ( ) if source == rog_ucp_main_img_sms then guiSetAlpha( source, 100 ) elseif source == rog_ucp_main then guiSetAlpha( source, 100 ) end end ) -- Back when leave addEventHandler( "onClientMouseLeave", root, function ( ) if source == rog_ucp_main_img_sms then guiSetAlpha( source, 255 ) elseif source == rog_ucp_main then guiSetAlpha( source, 255 ) end end )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now