You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 17-04-2014 12:27:31

kotleto
Contributors
Registered: 11-08-2013
Posts: 2

Semi-transparent tiles

Hi folks,
Do you know how can I do semi-transparent background of tiles on main page?

Thx in advance,
Kotleto

Offline

#2 17-04-2014 12:42:28

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Semi-transparent tiles

You need to use proper CSS background property value which looks like this and set this value to "background" property of tile in config/tiles.php.

Example:

$tile[] = array("background"=>"rgba(200, 54, 54, 0.5)","type"=>"img","group"=>0,"x"=>0,"y"=>3,'width'=>1,'height'=>1,"url"=>"URL","img"=>"PATH","desc"=>"","imgWidth"=>1,"imgHeight"=>1,"labelText"=>"TEXT","labelColor"=>"#F90","labelPosition"=>"top","classes"=>"","imgAlt"=>"ALT", "imgTitle"=>"TITLE");

Look at the beginning of array -> "background"=>"rgba(200, 54, 54, 0.5)".

Cheers. smile

Last edited by chrismaliszewski (17-04-2014 12:47:00)

Offline

#3 17-04-2014 14:22:20

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Semi-transparent tiles

Be aware that rgba is not supported in older browsers (IE8 or lower); it wil show no background. Maybe thats not a problem but if you want to show a fixed background for them you can try:

"background"=>"#FF0; background: rgba(200,54,54,0.5)"

it will set to #FF0 (you can change that) if rgba is not supported

The last argument of rgba is the transparency and you can find HEX to RGB(A) converters online btw: http://hex2rgba.devoth.com/

Offline

#4 18-04-2014 09:56:31

kotleto
Contributors
Registered: 11-08-2013
Posts: 2

Re: Semi-transparent tiles

Thx Chris and Thomas. I'm grateful. I'll test it, it is important for me that older than IE8 doesn't support transparency

Have a nice day

Offline

Board footer

Powered by FluxBB