Need Some Help Coding...
#1
Need Some Help Coding...
I read alot of tutorials and articles on having the code written for random images, rotating, on the main page, but just don't have the time to fool w/ it, right now.
I need someone to create an index.html for Ranger-Forums.
Basically, I want it to be the exact same as it is now, w/ all the coding, but want to change the main image to be a rotating image.
The images will sit in the folder: www.Ranger-Forums.com/rotate and will all be 800x450 in dimension. They will be titled as follows: 1.jpg, 2.jpg, 3.jpg, so on and so forth.
I want the placement, relative to the page to be the same as it is currently, and I want the image to be a link to: https://www.ranger-forums.com/forum2/home.php
Thanks in advance.
And if you don't know what I mean, go to www.SHSU.edu and refresh and watch the main image change.
Thanks.
I need someone to create an index.html for Ranger-Forums.
Basically, I want it to be the exact same as it is now, w/ all the coding, but want to change the main image to be a rotating image.
The images will sit in the folder: www.Ranger-Forums.com/rotate and will all be 800x450 in dimension. They will be titled as follows: 1.jpg, 2.jpg, 3.jpg, so on and so forth.
I want the placement, relative to the page to be the same as it is currently, and I want the image to be a link to: https://www.ranger-forums.com/forum2/home.php
Thanks in advance.
And if you don't know what I mean, go to www.SHSU.edu and refresh and watch the main image change.
Thanks.
#5
Originally Posted by Gearhead61
Dude it took you 18 minutes. Get your **** together... seriously
ha i started to do it then i saw his post for 5 min and was like crap, hes got me beat.
#10
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()
theImages[0] = 'rotate/1.jpg'
theImages[1] = 'rotate/2.jpg'
theImages[2] = 'rotate/3.jpg'
theImages[3] = 'rotate/4.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" height="450" width="800" border="0">');
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Ranger-Forums We are a web forum for Ford Ranger, Mazda B-Series, Explorers, and Bronco II owners. Though primarily a Ranger site, we are not for one certain style. Lowered trucks, 4x4's, prerunners, etc... All are welcome." />
<meta name="keywords" content="ford ranger, ford ranger edge, ford ranger tremor, ford ranger xlt, ford ranger xl, ford ranger fx4, ford ranger fx4 level II, ford ranger lift, ford ranger drop, ford ranger stuff, ford ranger web forum, ford ranger forum, ranger forums, ranger-forums, ranger forum, ford ranger part, ford ranger accessory, ford ranger performance, ford ranger truck, ford ranger," />
<title>Ranger-Forums: A Premiere Site For Ford Ranger Enthusiasts</title>
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style></head>
<body>
<div align="center">
<p> </p>
<p><a href="https://www.ranger-forums.com/forum2/home.php">
<SCRIPT LANGUAGE="JavaScript">
showImage();
</script>
</a> </p>
</div>
</body>
</html>
[/code]
to add/delete images to the rotation, just add to, or remove the selection lines;
theImages[4] = 'rotate/5.jpg'
theImages[5] = 'rotate/6.jpg'
etc etc.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()
theImages[0] = 'rotate/1.jpg'
theImages[1] = 'rotate/2.jpg'
theImages[2] = 'rotate/3.jpg'
theImages[3] = 'rotate/4.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" height="450" width="800" border="0">');
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Ranger-Forums We are a web forum for Ford Ranger, Mazda B-Series, Explorers, and Bronco II owners. Though primarily a Ranger site, we are not for one certain style. Lowered trucks, 4x4's, prerunners, etc... All are welcome." />
<meta name="keywords" content="ford ranger, ford ranger edge, ford ranger tremor, ford ranger xlt, ford ranger xl, ford ranger fx4, ford ranger fx4 level II, ford ranger lift, ford ranger drop, ford ranger stuff, ford ranger web forum, ford ranger forum, ranger forums, ranger-forums, ranger forum, ford ranger part, ford ranger accessory, ford ranger performance, ford ranger truck, ford ranger," />
<title>Ranger-Forums: A Premiere Site For Ford Ranger Enthusiasts</title>
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style></head>
<body>
<div align="center">
<p> </p>
<p><a href="https://www.ranger-forums.com/forum2/home.php">
<SCRIPT LANGUAGE="JavaScript">
showImage();
</script>
</a> </p>
</div>
</body>
</html>
[/code]
to add/delete images to the rotation, just add to, or remove the selection lines;
theImages[4] = 'rotate/5.jpg'
theImages[5] = 'rotate/6.jpg'
etc etc.
Last edited by barrman; 07-06-2006 at 12:55 PM.
#13
ha.
is there a way to do it w/o having to list all possible images? like have it just find whatever images are in the directory i specify, an automatically adjust to the proper dimensions?
is there a way to do it w/o having to list all possible images? like have it just find whatever images are in the directory i specify, an automatically adjust to the proper dimensions?
#14
i was trying to do something like this guy explains you wont have to list them out then
http://www.web-source.net/web_develo...dom_images.htm
http://www.web-source.net/web_develo...dom_images.htm
#15
[CODE]<script type="text/javascript" language="JavaScript">
NumberOfImagesToRotate = 3;
FirstPart = '<img src="image';
LastPart = '.jpg" width="800" height="450">';
function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}
//-->
</script>[/CODE]
NumberOfImagesToRotate = 3;
FirstPart = '<img src="image';
LastPart = '.jpg" width="800" height="450">';
function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}
//-->
</script>[/CODE]
Thread
Thread Starter
Forum
Replies
Last Post