Ranger-Forums - The Ultimate Ford Ranger Resource

Ranger-Forums - The Ultimate Ford Ranger Resource (https://www.ranger-forums.com/)
-   Ranger-Forums Office (https://www.ranger-forums.com/ranger-forums-office-13/)
-   -   Need Some Help Coding... (https://www.ranger-forums.com/ranger-forums-office-13/need-some-help-coding-25062/)

Trevelyn1015 07-06-2006 12:12 PM

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.

barrman 07-06-2006 12:22 PM

gotcha covered, christian. give me 5 minutes :o)

barrman 07-06-2006 12:40 PM

ok christian... done. want me to email it to you or something? and how many images do you want me to code it for? (you can add/remove later)

Gearhead61 07-06-2006 12:42 PM

Dude it took you 18 minutes. Get your sh!t together... seriously :biglaugh:

zabeard 07-06-2006 12:43 PM


Originally Posted by Gearhead61
Dude it took you 18 minutes. Get your sh!t together... seriously :biglaugh:


ha i started to do it then i saw his post for 5 min and was like crap, hes got me beat.

Gearhead61 07-06-2006 12:46 PM

Who's the resident smartass now!? :silly:

barrman 07-06-2006 12:46 PM

haha damn the VULTURES again!! hehe.

i noticed that too... oh well. it FELT like 5 minutes ;o)

Trevelyn1015 07-06-2006 12:47 PM

you cna post the code on here, use the "code" tag...

zabeard 07-06-2006 12:50 PM


Originally Posted by Gearhead61
Who's the resident smartass now!? :silly:

lol.

barrman 07-06-2006 12:50 PM

[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>&nbsp;</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.

zabeard 07-06-2006 12:50 PM


Originally Posted by barrman
haha damn the VULTURES again!! hehe.

i noticed that too... oh well. it FELT like 5 minutes ;o)


5... 18 samething.

barrman 07-06-2006 12:59 PM

now lets talk about payment, christian.

i want my truck in that rotation! :o)

Trevelyn1015 07-06-2006 01:01 PM

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?

zabeard 07-06-2006 01:04 PM

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

Trevelyn1015 07-06-2006 01:09 PM

[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]

barrman 07-06-2006 02:37 PM

it will auto-size them, but you have to list the images in the source.

i'll see if i can find a way to pull by folder...

Trevelyn1015 07-06-2006 08:35 PM

i just hate that w/ the current code i have to edit the index.html anytime i add more pics..


All times are GMT -6. The time now is 09:21 PM.


© 2024 MH Sub I, LLC dba Internet Brands