slide slide slid

This is a discussion on "slide slide slid" within the JavaScript Forum section. This forum, and the thread "slide slide slid are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 1st, 2007, 06:09
New Member
Join Date: Oct 2007
Location: Australia
Age: 62
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
slide slide slid

Gday
As a complete newbie i Have been having a ball UNTIL!!! i tried to put in a
java script slide code. I have used so many permutation i have lost the plot. Below is the script in my experiment page. If someone could guide me through it i would be a happy man I have put 2 email gif images in the <head> and repeated in the <body> section Ta Bryan

HTML: Select all
<html>
<head>
<title>Volume3 </title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
gSlideshowInterval = 2;
gNumberOfImages = 3;

gImages = new Array(gNumberOfImages);
gImages[0] = "graphics/email2_1.gif";
gImages[1] = "graphics/email2_2.gif";
gImages[2] = "http://www.webforumz.com/images/slideshow_3.gif";
gImages[3] = "http://www.webforumz.com/images/slideshow_4.gif";
gImages[4] = "http://www.webforumz.com/images/slideshow_5.gif";

function canManipulateImages() {
    if (document.images)
        return true;
    else
        return false;
}
function loadSlide(imageURL) {
    if (gImageCapableBrowser) {
        document.slide.src = imageURL;
        return false;
    }
    else {
        return true;
    }
}
function nextSlide() {
    gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
    loadSlide(gImages[gCurrentImage]);
}
gImageCapableBrowser = canManipulateImages();
gCurrentImage = 0;
setInterval("nextSlide()",gSlideshowInterval * 1000);
// -->
</SCRIPT>
</head>
<body>
<center>
<p align=center><a href="http://users.on.net/~bcullen"><img src="Graphics/email2.gif" width="114" height="45" border="0" alt="email2.gif - 634 Bytes" NAME="graphics/email2_1.gif"></A></p>
<p align=center><a href="http://users.on.net/~bcullen"><img src="Graphics/email2.gif" width="60" height="40" border="0" alt="email2.gif - 634 Bytes" NAME="graphics/email2_2.gif"></a></p>

</center>
</body>
</html>

Last edited by karinne; Oct 1st, 2007 at 14:04. Reason: Please use the vBcode [ html ] when inserting HTML code in your post.
Reply With Quote

  #2 (permalink)  
Old Oct 1st, 2007, 08:57
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: slide slide slid

What are the code used for or how does it looks like?
Or maybe you could show some of the working example so that we know what you are trying to archive here.

I notice that you get the javascript source code from the site http://simplythebest.net/scripts/, and I saw they are giving a complete guide on how to use the code.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #3 (permalink)  
Old Oct 1st, 2007, 09:26
New Member
Join Date: Oct 2007
Location: Australia
Age: 62
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: slide slide slid

Thank you for looking. What i want is to display the 4 separate sides of one item that rotate automatically.Instructions were insert one part of script in <head> done. Insert other part in <body> done. define images and set timer in <head>. I put in 5 seconds and 3 images. Does define images mean one image per array??. it then says to define the first image to appear in slideshow in the <body> and the Name="slide" must be included.In IMG SRC i put in the first gif. Am I on the right track?
Bryan
Reply With Quote
  #4 (permalink)  
Old Oct 1st, 2007, 09:38
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: slide slide slid

It is better for me if you could give me the link to the source of the javascript that you are using right now.

Maybe I will have a look at the code and try to use that for my refference. By the way, the only problem you have is that the image is not showing, am I right?

Try checking this code, I mean the link to your image could be wrong.
Code: Select all
gImages = new Array(gNumberOfImages);
gImages[0] = "graphics/email2_1.gif";
gImages[1] = "graphics/email2_2.gif";
gImages[2] = "images/slideshow_3.gif";
gImages[3] = "images/slideshow_4.gif";
gImages[4] = "images/slideshow_5.gif";
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #5 (permalink)  
Old Oct 1st, 2007, 10:09
New Member
Join Date: Oct 2007
Location: Australia
Age: 62
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: slide slide slid

Hi Monie
When i upload or use the software browser I get two separate images. One under the other. I made one gif smaller than the other so i could monitor them. Thank you for your time it is appreciated. I will load them into my site at link Volume 3
Bryan
Reply With Quote
  #6 (permalink)  
Old Oct 1st, 2007, 10:10
New Member
Join Date: Oct 2007
Location: Australia
Age: 62
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: slide slide slid

oops just in case the url is www.bcullen.on.net/~bcullen
Reply With Quote
  #7 (permalink)  
Old Oct 1st, 2007, 11:26
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: slide slide slid

Quote:
Originally Posted by Bcullen View Post
oops just in case the url is www.bcullen.on.net/~bcullen
URL doesn't seem to work.

edit:
found it, look at http://users.on.net/~bcullen/
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)

Last edited by welshstew; Oct 1st, 2007 at 11:37. Reason: found it
Reply With Quote
  #8 (permalink)  
Old Oct 1st, 2007, 11:37
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: slide slide slid

Quote:
Originally Posted by Bcullen View Post
and the Name="slide" must be included.
Bryan
Bryan, this part seems to be missing from your html. Your code looks like this:
Code: Select all
NAME="graphics/email2_1.gif"
If you change it to look like the above then it might start working.

If you are able to provide a link to tthe code you are trying to implment then I will be able to decode it better.

Stew

P.s. I know you are just starting out, but can you look at getting rid of the frames please. They don't look good and are really bad for search engines. you can achieve the same thing with asp includes or with php includes
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
  #9 (permalink)  
Old Oct 1st, 2007, 14:05
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: slide slide slid

Moving to the Javascript section.
Reply With Quote
  #10 (permalink)  
Old Oct 2nd, 2007, 10:02
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: slide slide slid

Quote:
Originally Posted by Bcullen View Post
Thank you for looking. What i want is to display the 4 separate sides of one item that rotate automatically.Instructions were insert one part of script in <head> done. Insert other part in <body> done. define images and set timer in <head>. I put in 5 seconds and 3 images. Does define images mean one image per array??. it then says to define the first image to appear in slideshow in the <body> and the Name="slide" must be included.In IMG SRC i put in the first gif. Am I on the right track?
Bryan
Okay, you're a little bit off the track with the instrcutions given..

What they mean is that you have to put an image in your <body> with the src of the first image in your slideshow. You then have to give that image the name "slide" literally.

eg. <img src="this.gif" name="slide" />

I have rewritten the code and added comments so you can see what's going on

HTML: Select all
<html>
<head>
<title>Volume3 </title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--

var gSlideshowInterval = 2; // Number of seconds between each slide change

var gImages = new Array(); // Don't worry about declaring the number of images, just define them numerically as below

gImages[0] = "graphics/email2_1.gif";
gImages[1] = "graphics/email2_2.gif";
gImages[2] = "http://www.webforumz.com/images/slideshow_3.gif";
gImages[3] = "http://www.webforumz.com/images/slideshow_4.gif";
gImages[4] = "http://www.webforumz.com/images/slideshow_5.gif";

function canManipulateImages() {
    if (document.images)
        return true;
    else
        return false;
}



// Will remove the whole nextSlide/loadSlide setup and just have one function that does all the work
var gCurrentImage = 0; // declare as a global variable
var numImages = gImages.length; // Count the number of images

function changeSlide()
{
	if (!canManipulateImages)
		return;

	gCurrentImage++; // Queue up the next image
	if (gCurrentImage >= numImages)
		gCurrentImage = 0; // If we have reached the start, queue up 0 again
	
	document.slide.src = gImages[gCurrentImage]; // This code says in the document change the source of the image with the name 'slide'
	document.slide.alt = gCurrentImage; // This is just so I could test as I couldn't find images to use and needed to see that the image was changing
	

}
// -->
</SCRIPT>
</head>
<body>
<center>
<p align=center><a href="http://users.on.net/~bcullen">
<!-- We only need to name one image 'slide', this will show the slideshow //-->
<img src="Graphics/email2.gif" width="114" height="45" border="0" alt="email2.gif - 634 Bytes" name="slide"></A>
</p>
<script type="text/javascript">
<!--
// Becauase some pages load slowly, we will start the slide show after we knwo for sure the images have loaded
gImageCapableBrowser = canManipulateImages();

setInterval("changeSlide()",gSlideshowInterval * 1000);
//-->
</script>
</center>
</body>
</html>

There you have it, a healthy working slideshow.

I hope that helps and was what you were looking for
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
High Slide? byrd80 JavaScript Forum 2 Mar 21st, 2008 20:02
Slide up and down DregondRahl JavaScript Forum 6 Oct 30th, 2007 21:10
Slide show/s :) OmiE Flash & Multimedia Forum 4 May 25th, 2007 04:55
Will it slide beneath? marksk Web Page Design 7 Apr 26th, 2007 08:58
Slide menus again benbacardi Flash & Multimedia Forum 4 Nov 18th, 2005 07:37


All times are GMT. The time now is 04:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43