![]() |
|
|
|
||||||||||
![]() |
|
|
Thread Tools |
|
#1
|
||||
|
||||
|
1) Is it possible to preload image using css? If yes, how?
Here is the format of my css.... Code:
body {
background-image: url(g9brk05.gif);
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 2px;
}
|
|
#2
|
||||
|
||||
|
preloading: javascript can pre-load images. Just pre-load the img you are using in your CSS background.
Random bg Image: you need to use some sort of css/altering language as in javascript or a server-side language. you could inline it and say: html4strict Code:
create 1000 images in your images folder called /img_1.gif, /img_2.gif etc.. |
|
#3
|
||||
|
||||
|
Quote:
Thanks for your tips. How to make a general random images? I mean when we don't have 1000 images or more than 1000 images. Thanks a bunch
__________________
US Bank Non Resident - Grab my proven strategy to open US Bank as non Resident NOW!
|
|
#4
|
||||
|
||||
|
just change url(/images/<?= "img_".rand(0,1000).".gif"; ?>) to however many images you have (make sure to make them in sequencial order)
so if you have 34 images - you would do url(/images/<?= "img_".rand(0,34).".gif"; ?>) |
|
#5
|
||||
|
||||
|
Thanks for your help.
__________________
US Bank Non Resident - Grab my proven strategy to open US Bank as non Resident NOW!
|
|
#6
|
||||
|
||||
|
Thanks ccoonen!
I will try that. |
|
#7
|
|||
|
|||
|
Work with ASP?
I see that this solution works for PHP, but by changing the code to ASP.NET, should it also work?
|
|
#8
|
|||
|
|||
|
for image preloading use the method illustrated here:
http://www.phpmysqlapache.com/ |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| css background image not showing in IE | rumblepup | CSS | 9 | Jan 16th 2010 11:25 am |
| CSS Site Background Image (not working in Firefox) | yo-yo | CSS | 9 | Oct 23rd 2007 4:37 am |
| Random header image using CSS | sc0ttish | CSS | 2 | May 12th 2006 1:47 pm |
| Why is IE covering my image with the background image? | Ticktockman | HTML & Website Design | 5 | Apr 11th 2006 6:41 am |
| Random Image Script not so random | 313i | Programming | 8 | Oct 26th 2005 5:03 am |