Need Some Help Coding... - Ranger-Forums - The Ultimate Ford Ranger Resource


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

Closed Thread
 
LinkBack 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,900
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
Member
 
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
gotcha covered, christian. give me 5 minutes :o)
  #3  
Old 07-06-2006
Member
 
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
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
RF Veteran
 
Join Date: May 2005
Location: College Station, TX
Posts: 5,782
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,045
Quote:
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
RF Veteran
 
Join Date: May 2005
Location: College Station, TX
Posts: 5,782
Who's the resident smartass now!?
  #7  
Old 07-06-2006
Member
 
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
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,900
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,045
Quote:
Originally Posted by Gearhead61
Who's the resident smartass now!?
lol.
  #10  
Old 07-06-2006
Member
 
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
[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 01:55 PM.
  #11  
Old 07-06-2006
zabeard's Avatar
who?
iTrader: (8)
 
Join Date: Nov 2004
Location: IN
Posts: 26,045
Quote:
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
Member
 
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
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,900
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,045
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,900
[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
Member
 
Join Date: May 2005
Location: San Diego, CA
Posts: 1,046
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,900
i just hate that w/ the current code i have to edit the index.html anytime i add more pics..
Closed Thread

Related Topics
Thread Thread Starter Forum Replies Last Post
Some Camburg, some BTF, some Bilstein, some OEM yeatzee Snapshots 17 08-14-2012 05:17 PM
I need new shocks and i need some help 2007BlackFX4 Suspension Tech 3 06-03-2010 08:36 PM
Some Snow, Some Flex, and Some Stuck (56k No Way) MothMan999 Snapshots 31 12-24-2009 10:08 PM


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 12:34 PM.


We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.