Div With Background image

23 posts by 3 authors in: Forums > CMS Builder
Last Post: September 16, 2011   (RSS)

Hi all

I have a div that i want to have a background in and i want to make it so each time the page is loaded it will random the image background i have a multi section setup with the images in it all the same size but i just cant get it to work anyone help.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Div With Background image

By robin - September 15, 2011

Hey Craig,

Could you post what you have so far and we'll see if we can help make it work?

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [kcmedia] Div With Background image

In the list viewer bit, add
'orderBy' => 'RAND()',
'limit' => '1',

This will give you a single, random record.

Then, for the div...

<div style="background-image="<?php for each....>">
content...
</div>
Cheers,

Tim (toledoh.com.au)

Re: [robin] Div With Background image

Hi Robin

here is the file just wont work keep getting an error in the code and wont show the image.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

index_040.php 6K

Re: [Toledoh] Div With Background image

Hi Tim

It is a multi record option and i dnt really understand what you meant with the other bit.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Div With Background image

Try this and let me know how you go.
Cheers,

Tim (toledoh.com.au)
Attachments:

index2_003.php 6K

Re: [Toledoh] Div With Background image

By KCMedia - September 15, 2011 - edited: September 15, 2011

Hi Tim

i tried that but still nothing here is the file i have updated in the code when it runs this what is says

<div id="home" class="main" style="background-image="style="background-image="/cmsAdmin/uploads/home-page-bg.png/cmsAdmin/uploads/home-page-bg_001.png/cmsAdmin/uploads/home-page-bg-1.png">
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

index_041.php 6K

Re: [kcmedia] Div With Background image

try this?
Cheers,

Tim (toledoh.com.au)
Attachments:

index3.php 6K

Re: [Toledoh] Div With Background image

Hi Tim

still no good.

just remember that at the moment csmb sits on the root of the html dir but the files are up one dir in newsite
Thanks



Craig

KC Media Solutions

www.kcmedia.biz