How can you make an image change every time you refresh a page?
Hi.
I've recently redone my website and was wondering how I could make the image on my main page change every time you refresh the page?
Like is there a certain script you can use?
Here's my website
www.liamfawcett.com
Thanks
Copy & Paste the following JavaScript code between the <head> and </head> tags in your HTML document, in Code View of course.
<script type="text/javascript">
<!--//Random Banner image on Page Reload
//store the images in arrays below
images = new Array(5);
images[0] = "<a href='http://www.example.com'><img src='some_image.gif' </a>";
images[1] = "<a href='http://www.example.com'><img src='some_image.gif' </a>";
images[2] = "<a href='http://www.example.com'><img src='some_image.gif' </a>";
images[3] = "<a href='http://www.example.com'><img src='some_image.gif' </a>";
images[4] = "<a href='http://www.example.com'><img src='some_image.gif' </a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
//done
// -->
</script>
In the array, change URLs (http://www.example.com) to your own links. Change images (some_image.gif) to your own images.
Save page. Preview in browser. Hit refresh (F5 or Ctrl+R) to see the images change.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb
http://alt-web.blogspot.com
Similar Messages
-
How can I make Photos not open every time a photo card is inserted?
Hello,
Every time I insert an SD or CF card or even my iPhone, Photos opens up. How can I stop this from happening? I looked everywhere and I can't find a solution, thanks.Go to Edit> Preferences. Under "Import Options" uncheck "Show import dialogue when memory card is inserted".
-
How can I make my computer sync every time I start firefox?
I want to setup my computer sync automatically every time I start Firefox. Is there any way to do this?
Thanks for any reply..That is the way Mac OS X 10.8 (aka Mountain Lion) works by default. Are you actually running that system? (See About This Mac in the Apple menu.) If so, make sure the check box in the shut down alert is checked:
-
How can I make background images change automatically
I want my page background to change automatically after a set period of time (almost like a very slow slideshow). Is there any reason (other than file size) I can't simply do this with an animated gif as my body background image? I haven't got the expertise to do anything too technical. Thanks
Is there any reason (other than file size) I can't simply do this with an animated gif as my body background image?
BG images are not meant to be animated. It's a performance problem - the browser would have to continually re-render the whole page, since GIFs work on specific increments. That's why it's not supported. What you wanna do would be best done with jQuery/ JavaScript or Flash, where the substitution can be controlled, so the browser only needs to work hard when there is actualyl something changing. whether that's a good idea, is another matter, though. Personally I really despise such toy-ish features, as they severely impair usability and readability.
Mylenium -
How can I make the iPhone beep every hour ?
How can I make the iPhone beep every hour ?
Just a beep not an alarm (alarms require an acknowledgement)I wanted this function as well and I just downloaded "BBClendar Free" and it works perfectly for this, better than an inexpensive digital watch!
Just go to the Advanced section, enable the hourly beep and even set which hours (mine is 8 AM - 10 PM) and what minute of each hour it beeps on. Just be sure to leave the program open when you go on standby or it won't beep.
As the App's description says, "Hourly Beep helps you to take a moment to rest in a busy day for every hour."
Enjoy! -
How can I make a image like this one? (image in description)
Hi guys I need to know how can I make a image like this one http://img31.imageshack.us/img31/2710/69823211.gif
I need step by step instructions please. How can I animate it like that? Whats the font? Tell me everything please.To do a step by step instruction on here will take someone a very long time, as you havent really said at what level you are at.
On Youtube there are a lot of animation tutorials for PS. But essentially in this case you are moving that white streak across a few frames at a time.
The font might be found with the help of http://http://www.myfonts.com/WhatTheFont/ -
How can I make an image appear partially in front and partially behind another layer in Adobe Illustrator?
Put the image behind the layer (at the back of it or on a layer below). With it still selected, Copy.
Now Paste in Front (Ctrl+F). Depending on your Paste Remembers Layers setting, you may have to bring the newly pasted copy to the front, or to the upper layer.
Draw a shape over the image to define the portion of it you want to appear "in front."
With the shape and the image selected, clip the image using the shape. (Object > Clipping Mask > Make) -
How can i make firefox reload automaticly every hour?!!!
how can i make firefox reload automaticly every hour?!!!
I download add-ons Reload Every
how to manage it((setting))?!!!
thanks addvance>>You installed the ReloadEvery Extension rather and not downloaded it to disk.
To set the reload time for the tab you are viewing you can right-click the page and select a time.
http://reloadevery.mozdev.org/
http://reloadevery.mozdev.org/screenshots.html -
How can I make a global change so all controls and indicators labels on the front panel change to another colour?
I need to change the front panel so that it can be used in a dark environment.Hi
The only way I see, is to use the "Controls[]" property and iterate through all of them. But don't forget about nested elements (i.e. clusters, tab-controls, ...).
Thomas
Using LV8.0
Don't be afraid to rate a good answer... -
How can I make an image placed in the body tag expand to the entire width of the browser?
How can I make an image placed in the body tag expand to the entire width of the browser?I
background-repeat -- best used with small image tiles.
background-gradient - Ultimate CSS Gradient Generator - ColorZilla.com
background-size:cover - Resizable Full Page Background Image
Nancy O. -
How can i fix start botton ? Every time i need to press more to work.
How can i fix start botton ? Every time i need to press more to work.
Are you using any fonts in this file that you don't normally use?
I'd also try the script at Adobe Community: InDesign 6 is crashing when attempting to open a particular document. All others are opening OK. and the tool at Repair corrupt InDesign Adobe files on Mac OS X -
How can i stop receiving emails notifications every time i log in to find my iphone?
how can i stop receiving emails notifications every time i log in to find my iphone?
I too would like this answer please
-
How can you delete a Pages document from your Ipad but keep it on your MAC?
How can you delete a Pages document from your Ipad but keep it on your MAC?
You will need to keep them in folder on your hard drive somewhere other than in iTunes or they will be deleted from iTunes if you delete them from the device. I have a folder on my Mac called iPad Pages Documents - very original don't you think!
Here is the support article that explains it all.
http://support.apple.com/kb/HT4094 -
How can I make the image number biger in a PDF presentation?
How can I make the original image number, biger, located on the lower part of the picture in a PDF presentation so people don't have to zoom in 50% or 100% in order to see number of each picture in a automate PDF presentation. Thank you for your help
When a document is signed, the signer has the option of locking the document. The links won't be active if the document is locked, so to avoid this, instruct the signer not to lock when signing.
-
In IE the page can either be set to 100% or whatever you wish, and once set future pages open up displayed the same way. With FF every time I open a page I have to hit ctrl+ about 3 or 4 times to get it to fill the screen
I have tried changing the default font to 16 with a min of 16 and not letting the page decide etc. I am sure that this has been asked before, but I have not used FF in several years.
ThanksThere are some add-ons that can be used to change the zoom level on all sites, for example:
* NoSquint - https://addons.mozilla.org/firefox/addon/nosquint/
* Default FullZoom Level - https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
Maybe you are looking for
-
My iPhone will not work unless I plug it into my wall charger, It is fully charged but only works when it is plugged in to wall charger. When it is turned on it say "Restore needed iphone can not make or receive calls' i tried plugging it up to Itune
-
Help needed Regarding Project Server - 2013 Workflow
Hi All, I am new to Project server 2013 Workflow, hence please help me regarding this. Pardon me if this question is too trivial. I have created a project type associated with a workflow and my workflow is as follows : So I am not doing anything her
-
Need Advice on External Hard Drive Error
I just purchased the OWC 750g External Firewire HD for my Imac G4, plugged it in and it appeared in my Finder. The User Guide says that I need to use Disc Utility to repartition the drive, which I did, in 3 partitions - two to be bootable drives for
-
My wife's iPhone 5c only plays through the right speakers in our 2014 Toyota Prius, whether through Bluetooth or USB. My iPhone 5c works great. Anyone have a similar situation?
-
I want to download my iCloud backup (from iPhone) to my Mac
Hi I got my iPhone stolen for the 2nd time in 3 Months now. And will definetly buy another one when I have cash again, for now I just try to life with a blackberry and an iPad mini. But I got the problem now that my iCloud storage reached its limit a