#1
| |||
| |||
Random images in CSS I am trying to edit and change a theme applied to a Coppermine gallery. I have some basic knowledge of HTML, but that's all. HTML Code: .header{ background: url(images/headerbg.gif) no-repeat; width: 760px; height: 143px; float: left; } HTML Code: <?
$imgs = array("image1.gif", "image2.gif", "image3.gif");
srand ((double)microtime()*1000000);
shuffle($imgs);
echo '<img src="repertoireimages/' . $imgs[0] . '" BORDER = "0" alt="" />';
?> |
#2
| |||
| |||
Re: Random images in CSS Sorry mate but we can not do CSS dynamic. In your case, you can make CSS to set the format for this image against what will appear from the PHP |
#3
| |||
| |||
Re: Random images in CSS Overload your style in your page header PHP directly into the tag. HTML Code: <? $imgs = array("image1.gif", "image2.gif", "image3.gif"); srand ((double)microtime()*1000000); shuffle($imgs); ?> ... <div style="background: url(<?echo 'repertoireimages/' . $imgs[0]; ?>) no-repeat"> ... |
#4
| |||
| |||
Re: Random images in CSS Well, I'll consider that, for all you say is to change the header of my Coppermine gallery. The image is placed by the CSS, hence my question. |
#5
| |||
| |||
Re: Random images in CSS In fact, rather than putting the image via CSS, it must be placed directly on the page via a php style always. You want in your page .php tag that contains the words "class = header" and put in this tag HTML Code: class="header" style="background: url(<?echo 'repertoireimages/' . $imgs[0]; ?>) no-repeat"> |
#6
| |||
| |||
Re: Random images in CSS Well, I just turned but the different DIV bother me (not to the desired image in the background) and I am back on good old tables! Now it is impossible to eat my random image in the background of the table. HTML Code: <script language="JavaScript"> banner(); </SCRIPT> How? |
#7
| |||
| |||
Re: Random images in CSS On your index.php add the following code: PHP Code: PHP Code: PHP Code: PHP Code: |
#8
| |||
| |||
Re: Random images in CSS Hey perfect, thank you very much! I just go with this code without much understanding, hope it will help me! |
![]() |
|
Tags: css, image, random |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Generate some quality of random number via Random Number Generation function | aMADeO! | Windows Software | 4 | 13-01-2012 05:07 PM |
How to add images to Google Images | Monty1 | Tips & Tweaks | 2 | 14-02-2011 01:15 PM |
Random images appear while playing BattleField Bad Company 2 | $Beyonce$ | Video Games | 3 | 23-11-2010 10:03 PM |
How to use "Math.random()" to generate a random number in JavaScript? | Silent~Kid | Software Development | 5 | 03-02-2010 05:06 AM |
PHP Random image 3 images in a row | fastrod | Software Development | 4 | 09-03-2009 01:40 PM |