script> - // (C) 2000 www.CodeLifter.com
-
// http://www.codelifter.com
-
// Free for all users, but leave in this header
-
// NS4-6,IE4-6
-
// Fade effect only in IE; degrades gracefully
-
-
// =======================================
-
// set the following variables
-
// =======================================
-
-
// Set slideShowSpeed (milliseconds)
-
var slideShowSpeed = 5000
-
-
// Duration of crossfade (seconds)
-
var crossFadeDuration = 3
-
-
// Specify the image files
-
var Pic = new Array() // don't touch this
-
// to add more images, just continue
-
// the pattern, adding to the array below
-
-
Pic[0] = '1.jpg'
-
Pic[1] = '2.jpg'
-
Pic[2] = '3.jpg'
-
Pic[3] = '4.jpg'
-
Pic[4] = '5.jpg'
-
-
// =======================================
-
// do not edit anything below this line
-
// =======================================
-
-
var t
-
var j = 0
-
var p = Pic.length
-
-
var preLoad = new Array()
-
for (i = 0; i < p; i++){
-
preLoad[i] = new Image()
-
preLoad[i].src = Pic[i]
-
}
-
-
function runSlideShow(){
-
if (document.all){
-
document.images.SlideShow.style.filter="blendTrans(duration=2)"
-
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
-
document.images.SlideShow.filters.blendTrans.Apply()
-
}
-
document.images.SlideShow.src = preLoad[j].src
-
if (document.all){
-
document.images.SlideShow.filters.blendTrans.Play()
-
}
-
j = j + 1
-
if (j > (p-1)) j=0
-
t = setTimeout('runSlideShow()', slideShowSpeed)
-
}
-
</script>
-
i am using this javascript code for slideshow of images...i am in a small problem.....wht my client requires is tht when ever he puts a image in a particular folder tht image must be involved in the slideshow with out specifying the name of the image in code....is there any way so as to make javascript to pick all images in a folder and create a slideshow
2 3143 Dasty 101
Recognized Expert New Member
Your javascript code runs on client computer. So it does not have direct access to get webserver directory structure - content (and it is anyway forbidden on 99% of web servers anyway - i mean browse rights). You have to use server's code (php / aspx) to get all images in web's directory and sent the result to client.
Your javascript code runs on client computer. So it does not have direct access to get webserver directory structure - content (and it is anyway forbidden on 99% of web servers anyway - i mean browse rights). You have to use server's code (php / aspx) to get all images in web's directory and sent the result to client.
It's a good solution, but he did say he wanted previous/next buttons.
this should work, though, i did not test it. - <%
-
'//----------------------------------------------------
-
'// declare some constants and variables
-
'//----------------------------------------------------
-
dim oFileSystem, oFolder, nFile, i, aFilenames, lookUp
-
-
i = 0
-
const IMAGE_DIRECTORY = "/path_to_my_image_directory/"
-
-
'//----------------------------------------------------
-
'// set up FSO
-
'//----------------------------------------------------
-
set oFileSystem = server.createobject("scripting.filesystemobject")
-
-
'//----------------------------------------------------
-
'// get all images in image directory, store filenames
-
'// in array
-
'//----------------------------------------------------
-
set oFolder = oFileSystem.getFolder(server.mappath(IMAGE_DIRECTO RY))
-
-
'//----------------------------------------------------
-
'// resize array to fit number of files in directory
-
'//----------------------------------------------------
-
redim aFilenames(oFolder.files.count - 1)
-
-
'//----------------------------------------------------
-
'// loop through files in folder, assign each to
-
'// index in array
-
'//----------------------------------------------------
-
for each nFile in oFolder.files
-
aFilenames(i) = nFile.name
-
i = i + 1
-
next
-
-
set oFolder = nothing
-
set oFileSystem = nothing
-
-
'//----------------------------------------------------
-
'//determine which image the user wants to look at
-
'//----------------------------------------------------
-
if request.querystring("pic") <> "" and isnumber(request.querystring("pic")) then
-
lookUp = cint(request.querystring("pic"))
-
'//----------------------------------------------------
-
'// make sure the value of lookUp doesn't break
-
'// our array bounds
-
'//----------------------------------------------------
-
if (lookUp < 0 or lookUp > ubound(aFilenames)) then
-
lookUp = 0
-
end if
-
else
-
lookUp = 0
-
end if
-
%>
- <html>
-
<body>
-
<img src="<%= IMAGE_DIRECTORY %><%= aFilenames(lookUp) %>" />
-
<br />
-
<a href="?pic=<%= lookUp - 1 %>"><< Previous</a> <a href="?pic=<%= lookUp + 1 %>">Next >></a>
-
-
</body>
-
</html>
..
See to this code which i got from the form forum...
I think it will help u....
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Susanna |
last post by:
Hi all,
I'm using the following slideshow script that I found on the web to
display changing images with a crossfade effect. Eventually I will be
adding many more images to the slideshow. The thing is, I ALSO have
to make it so the images will load randomly. I have looked at a
number of scripts for random-loading slideshows, but I have to find a
way to COMBINE this fading-image script (or, a different fading-image
script, if...
|
by: Jeannie |
last post by:
I have a popup window which is a slideshow of about 7 images. When the
popup window loads, the first image is present and then the viewer can
select next or previous to scroll through the rest of the images.
I'd like to use the same popup window at different points throughout
the website and have the Virtual Tour (slideshow) open up at the
appropriate photos. Meaning I'd like to control which picture the
popup window opens up to,...
|
by: drillbit_99 |
last post by:
I have an HTML page of thumbnail images. Each image can begin a
slideshow of the images on the page by clicking on the image. This
opens another HTML page that begins the slideshow using large images of
the thumbnails. When the slideshow begins it always starts with the
first image. I would like to pass the name of the thumbnail to the
slideshow HTML page and begin the slideshow with the same image the
user clicks on. Is this asking...
|
by: David Graham |
last post by:
Hi
New to javascript. I'm trying to understand how a script at a website I come
across works.
http://www.BRPPISAFETY.COM
Nearly got it but I have changed the variable called 'crossFadeDuration'
to large numbers and small numbers but it doesn't seem to do anything. Could
someone explain what effect changing this variable should bring about and
why don't I see any changes.
many thanks
David
|
by: Lanky |
last post by:
I am using the Dynamic Ajax Content script from Dynamic Drive (http://dynamicdrive.com/dynamicindex17/ajaxcontent.htm) and trying to load the Ultimate Fade-In Slide Show also from Dynamic Drive (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm.) Both work just fine independently, but the slide show script won't work when I try to load it with the Ajax Content Script - as if they are conflicting. Any ideas?
| |
by: ttamilvanan81 |
last post by:
Hai everyone,
I need to provide the slideshow for the images.
I have upload the images into database. Then i will retrive all the images from the database and provide the slideshow for those images. I have try with the following jsp code.
<%@ page language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.sql.Connection.*"%>
<%@ page import="java.awt.image.*"%>
|
by: pradeepjain |
last post by:
script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// =======================================
// set the following variables
// =======================================
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |