Thanks Bobby and everyone. CfContent did the trick. :)

-----Original Message-----
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 20, 2006 4:28 PM
To: CF-Talk
Subject: RE: Quick CF & CSS question.


I replied before all the emails came in ;-)
You obviously already had the idea of background: url(../hdrs/header.cfm);

So if I had a directory full of images named in sequence like...

img01.jpg, img02.jpg, img03.jpg etc... through img20.jpg...

And I wanted header.cfm to feed these images randomly then id just use this
cfcontent tag

<cfcontent type="image/jpeg"
file="d:\path\to\image\files\img#numberformat(randrange(1, 20), '00')#.jpg">

Then I could just use <img src="header.cfm">

Or in your case...

background: url(..hdrs/header.cfm);

of course it depends on the images being named in sequence, else you would
just cfdirectory and filter everything but images then choose a random image
from there for the "file" attribute of the cfcontent tag

If you used cfdirectory, Id personally store the results in a persitant
scope like session or application and only run cfdirectory when that
variable is empty just to save on the overhead.

Good luck


...:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

 

 


-----Original Message-----
From: Che Vilnonis [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 18, 2006 4:09 PM
To: CF-Talk
Subject: Quick CF & CSS question.

I've got this line of code in a CSS file (default.css).

        background: url(../_hdrs/header1.jpg);

I'd like to change it to have a random image generated using something like
this

        background:
url(../_hdrs/header<cfoutput>#DayOfWeek(Now())#</cfoutput>.jpg);

How can I do this with a CSS file? Can this be done w/o changing the
extension to .cfm?

Thanks, Che






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250452
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to