logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-16-2009, 05:48 PM   #1
Butters
 
Join Date: Feb 2009
Posts: 4
Default Rotating Images from a Directory

Hi. I've been searching for JavaScript to rotate the main image on my home page every few seconds. My needs were:

-instead of listing every image path to the script, I want to be able to just add images to a directory, and have the script automatically rotate whatever is in that directory.

-i don't want to use php because i want to keep this page as the index.html page for search engines.

-Includes a 'noscript' plan if javascript isn't enabled.

I found a ton of scripts but they all satisfy two necessities but not the third. I just tried using the script at...

http://www.dreamweaverclub.com/forum...ad.php?t=29012

...but then I realized that it only rotates on reload. I've tried adding lines like var delay = 3000 (I'm a photographer, not a programmer) but to no avail. Do someone know how to do this? It's easy to find PHP that will pull anything from a directory and rotate in a specified amount of time--but how about JavaScript?

Thanks.
Brandon
Butters is offline   Reply With Quote
Old 02-16-2009, 07:27 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

you can do this in flash
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-16-2009, 10:02 PM   #3
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Quote:
Originally Posted by Butters View Post
-i don't want to use php because i want to keep this page as the index.html page for search engines.
Search Engines does not rank .html file extensions better or higher or anything. Fire the person that told you so.

If you don't know JavaScript, consider using a framework like jQuery, which makes it easy for designers to use all kinds of great effects.

Quote:
Originally Posted by davidj View Post
you can do this in flash
You could probably do it with a Java applet as well, but nothing beats some unobtrusive JavaScript that degrades gracefully.
domedia is offline   Reply With Quote
Old 02-17-2009, 05:13 AM   #4
Butters
 
Join Date: Feb 2009
Posts: 4
Default

It's not about the .html page type, it's about the fact that index.html is the root of the website, and index.php isn't. Although there isn't much on this page anyway, so it might not make much difference for me.

So I decided to make the .com (index.html) page redirect to a php page with a script I found that apparently uses php to extract the names of the files from a directory for javascript to swap. The script that fades them in and out nicely--but I can't get it to work for me. When I tried the page it just displayed all of the jpgs at once, and with no rotation.

http://www.linein.org/blog/2008/01/1...y-with-plugin/

Oh well, I'll keep searching....

Wait...if I post the page contents, can someone tell me what I've done wrong?
Butters is offline   Reply With Quote
Old 02-17-2009, 06:44 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

if you have copied the script 'as is' then on this line

PHP Code:
<UL id=image_rotate style="LIST-STYLE-TYPE: none"
< ?= 
$image_rotation?> </SPAN>
</UL> 
you need to remove the space between the first <?

it currently looks like this < ?

Im not saying it will fix it but it was obvious so thought id mention it
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-17-2009, 07:03 PM   #6
Butters
 
Join Date: Feb 2009
Posts: 4
Default

Thanks, but I have it right. She must've fixed that in the text file.

Here is my page on the server:

www.caleventphoto.com/index.php

I don't want to use flash because I just want to be able to occasionally add more files to the server directory.
Butters is offline   Reply With Quote
Old 02-18-2009, 03:41 PM   #7
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Quote:
Originally Posted by Butters View Post
Thanks, but I have it right. She must've fixed that in the text file.
Who? Are you not developing this?
Quote:
Originally Posted by Butters View Post
I don't want to use flash because I just want to be able to occasionally add more files to the server directory.
There must be a misunderstanding. Flash slideshows will get their images from a directory just like a JavaScript slideshow will.
domedia is offline   Reply With Quote
Old 02-18-2009, 03:53 PM   #8
Butters
 
Join Date: Feb 2009
Posts: 4
Default

"She" is the person that put up that PHP/jQuery script. But I read the name wrong--it is a "he".

Flash I'm fine with--in fact it's probably more compatible-- but I don't know how much I can develop it here. Although I do have the old Flash program on my Mac, I haven't opened it in years, and I don't even know if it will open since I've upgraded to Leopard.

I guess it can't be that hard--Is this something easy to learn in Flash for a non-developer? (not that I know anything about any other language).
Butters is offline   Reply With Quote
Old 02-18-2009, 04:54 PM   #9
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

You can do slideshows in JS or Flash..
If you're not a developer, I would look into using a Javascript framework, like jQuery, and use one of their slideshow plugins. It's going to require *some* technical knowledge, but it's the path of least resistance afaik,
domedia is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 06:02 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com