Hi Team,
I want to make random background, I did as below :
CSS file :
// Have my image under localhost/site/images/bg/<image file>
#jf-body {
padding: 0px;
margin: 0px;
background-image:url('<?php echo JURI::root(); ?>images/bg/<?php echo $bg_image; ?>');
background:url('<?php echo JURI::root(); ?>images/bg/<?php echo $bg_image; ?>');
/**background:url(../images/jf_body.png) repeat-x top left #666666';**/
}
Code under HTML:
<?php
// Array with associations: Itemid <-> background image
$bg_images = array(
"1" => "1.jpg",
"27" => "2.jpg",
"50" => "3.jpg",
"default" => "4.jpg" // default background image
);
$itemID_value = JRequest::getVar('Itemid');
$bg_image = (isset($bg_images[$itemID_value])) ? $bg_images[$itemID_value] : $bg_images["default"];
$url = JURI::root();
?>
I can see my file path correctly, but site doesn't get any it remains in white background. Please help.
Thanks .
Raj