Ranger-Forums Office Post all comments, questions, and suggestions about the site in this sub-forum. Announcements will be posted here as well.

Need Some Help Coding...

Thread Tools
 
Search this Thread
 
  #1  
Old 07-06-2006
Trevelyn1015's Avatar
Still El Presidente...
Thread Starter
Join Date: May 2004
Location: Texas
Posts: 4,902
Likes: 0
Received 3 Likes on 1 Post
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.
 
  #2  
Old 07-06-2006
barrman's Avatar
Member
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
Likes: 0
Received 1 Like on 1 Post
gotcha covered, christian. give me 5 minutes :o)
 
  #3  
Old 07-06-2006
barrman's Avatar
Member
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
Likes: 0
Received 1 Like on 1 Post
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)
 
  #4  
Old 07-06-2006
Gearhead61's Avatar
RF Veteran
Join Date: May 2005
Location: College Station, TX
Posts: 5,782
Likes: 0
Received 2 Likes on 2 Posts
Dude it took you 18 minutes. Get your **** together... seriously
 
  #5  
Old 07-06-2006
zabeard's Avatar
who?
iTrader: (8)
Join Date: Nov 2004
Location: IN
Posts: 26,044
Likes: 0
Received 10 Likes on 10 Posts
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.
 
  #6  
Old 07-06-2006
Gearhead61's Avatar
RF Veteran
Join Date: May 2005
Location: College Station, TX
Posts: 5,782
Likes: 0
Received 2 Likes on 2 Posts
Who's the resident smartass now!?
 
  #7  
Old 07-06-2006
barrman's Avatar
Member
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
Likes: 0
Received 1 Like on 1 Post
haha damn the VULTURES again!! hehe.

i noticed that too... oh well. it FELT like 5 minutes ;o)
 
  #8  
Old 07-06-2006
Trevelyn1015's Avatar
Still El Presidente...
Thread Starter
Join Date: May 2004
Location: Texas
Posts: 4,902
Likes: 0
Received 3 Likes on 1 Post
you cna post the code on here, use the "code" tag...
 
  #9  
Old 07-06-2006
zabeard's Avatar
who?
iTrader: (8)
Join Date: Nov 2004
Location: IN
Posts: 26,044
Likes: 0
Received 10 Likes on 10 Posts
Originally Posted by Gearhead61
Who's the resident smartass now!?
lol.
 
  #10  
Old 07-06-2006
barrman's Avatar
Member
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
Likes: 0
Received 1 Like on 1 Post
[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.
 

Last edited by barrman; 07-06-2006 at 12:55 PM.
  #11  
Old 07-06-2006
zabeard's Avatar
who?
iTrader: (8)
Join Date: Nov 2004
Location: IN
Posts: 26,044
Likes: 0
Received 10 Likes on 10 Posts
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.
 
  #12  
Old 07-06-2006
barrman's Avatar
Member
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
Likes: 0
Received 1 Like on 1 Post
now lets talk about payment, christian.

i want my truck in that rotation! :o)
 
  #13  
Old 07-06-2006
Trevelyn1015's Avatar
Still El Presidente...
Thread Starter
Join Date: May 2004
Location: Texas
Posts: 4,902
Likes: 0
Received 3 Likes on 1 Post
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?
 
  #14  
Old 07-06-2006
zabeard's Avatar
who?
iTrader: (8)
Join Date: Nov 2004
Location: IN
Posts: 26,044
Likes: 0
Received 10 Likes on 10 Posts
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
 
  #15  
Old 07-06-2006
Trevelyn1015's Avatar
Still El Presidente...
Thread Starter
Join Date: May 2004
Location: Texas
Posts: 4,902
Likes: 0
Received 3 Likes on 1 Post
[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]
 
  #16  
Old 07-06-2006
barrman's Avatar
Member
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
Likes: 0
Received 1 Like on 1 Post
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...
 
  #17  
Old 07-06-2006
Trevelyn1015's Avatar
Still El Presidente...
Thread Starter
Join Date: May 2004
Location: Texas
Posts: 4,902
Likes: 0
Received 3 Likes on 1 Post
i just hate that w/ the current code i have to edit the index.html anytime i add more pics..
 
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
yeatzee
Snapshots
18
04-05-2020 05:28 PM
2007BlackFX4
Suspension Tech
3
06-03-2010 07:36 PM
MothMan999
Snapshots
31
12-24-2009 09:08 PM



Quick Reply: Need Some Help Coding...



All times are GMT -6. The time now is 03:47 AM.