Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 03:43:15 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149660 Posts in 21100 Topics by 7539 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: random image as random background image?  (Read 1587 times)
Aaaarco

Offline Offline

Posts: 25


« on: December 31, 2008, 02:51:04 PM »

is it possible to have a random backgound image for a div

something like this:

<div id="content" style="background-image: url(<?php RandomImage ('url(/media/headers-home/'); ?>)>
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4755



« Reply #1 on: December 31, 2008, 03:13:21 PM »

As I seeyou allready did install the RandomImage Module, right?

And you also have the "headers-home" directory in the media directory, right?

<div id="content" style="background-image: url(<?php RandomImage ('url(/media/headers-homeX'); ?>)>

I didn't test, but what will happen if you delete the last backslash? X

(Never used this Module, just have found this piece of code via the search function:
http://www.websitebaker2.org/forum/index.php/topic,8498.msg51125.html#msg51125 )

Regards,
Stefek

Let me know.
Ifnot working I will finally test this module  wink
« Last Edit: December 31, 2008, 03:14:57 PM by Stefek » Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Aaaarco

Offline Offline

Posts: 25


« Reply #2 on: December 31, 2008, 03:46:00 PM »

thanks for the reply,

yes I installed the module and the headers-home folder is present in the media

but no, even without a slash it still turns out giving me no image



Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4755



« Reply #3 on: December 31, 2008, 03:49:42 PM »

All right.

In this case I will take a deeper look into it.
But won't be this year anymore  smiley

Probably another User has the right hint for you earlier than me.

Best Regards and a Happy New Year!

Christian Stefan
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
BerndJM

Offline Offline

Posts: 1764



« Reply #4 on: December 31, 2008, 05:19:12 PM »

Hi,
as far as I remember the randomimage function returns a
<img src="...." />
that means the whole html-string to reference an image, and this can not work as a css-call for a background image.
Long time ago I posted a solution for a random function that can do both a random image and a random background via a additional parameter, but can't find it at this moment.

Regards Bernd
Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
mr-fan

Offline Offline

Posts: 1538


WWW
« Reply #5 on: December 31, 2008, 06:48:09 PM »

Hi,

maybe this is important hint the topic is german but code is code  wink

many examples....http://www.websitebaker2.org/forum/index.php/topic,7593.0.html

maybe its possible to implement random snippet to one of the hint from this threat

good new year

martin
Logged

 
Aaaarco

Offline Offline

Posts: 25


« Reply #6 on: December 31, 2008, 07:51:58 PM »

http://www.websitebaker2.org/forum/index.php/topic,6376.0.html

this is the s***

thanks al whole lot mr BerndJM

Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!