PDA

View Full Version : Slideshow



Stuatnt
06-16-2011, 08:06 AM
1) Script Title: Drop In Slideshow

2) Script URL (on DD):

3) Describe problem:

I am a new to scripting and hence I have been experiencing some problems when trying to get the script working.

I have downloaded the above script and inserted the first element of the script into the <HEAD> section as stated and the second element into the <Body>.

Below is the code I have applied

<HEAD>

<script type="text/javascript" src="http://www.xsitetest.com/dropinslideshow.js">

/***********************************************
* Drop-in Slideshow Script- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>


<Body>

<script type="text/javascript">

//Define Image Array. Syntax: ["image_path", "url_destination", "url_target"]
var myimages=new Array()
myimages[0]=["/Images/image1.jpg", http://www.xsitetest.com/Chrustmaster.html, "_Blank"]
myimages[1]=["/Images/Rat.jpg", http://www.xsitetest.com/Chrustmaster.html, "_Blank"]
myimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"]

//Create new drop-in slideshow
//Syntax: new dropinslideshow(image_array, slideshow_width, slideshow_height, delay_before_rotation)
new dropinslideshow(myimages, 200, 250, 3000)

</script>

As you can see I have changed the source in the HEAD section to reflect my site etc. Please note this is merely a test site but i wanted to test this against a site before promoting to one of my soon to go live sites.

My questions are:-

1) As you can see from the <Body> code against the myimages... I have basically created an Images folder on the root of my drive etc and referenced my site and the specific page ont he site i want the slideshow to appear, however I do not know if this is how the images shoudl be referenced.

Should they be in a particular folder or referenced in a particular way such C:\Images\.... etc, as I am unclear as to how they shoudl be referenced.

2) I have also downloaded the dropinslideshow.js as instructed via the site, however again i am unsure as to where this should sit. I have currently placed this into the same folder as the images e.g. Images folder ont he root, however again I am uncertain as to where this should be located for it to work.

Can anyone offer some insight on the above to helpa very frustrated individual.

Many thanks

Stuart

Beverleyh
06-16-2011, 08:38 AM
You forgot the link to the script on DD - is it this one?: http://www.dynamicdrive.com/dynamicindex14/dropitslide.htm

(please always provide the link - asking for help but also asking for us to go hunting for stuff on your behalf reduces the likelihood of a reply)

1) - When online, Images (or javascript and css files) should be reference as an absolute link ('http://www.xsitetest.com/Images/image1.jpg') OR as a relative link ('/Images/image1.jpg') and must be in the location specified by the script. If you're working on your computer and not connected to the internet, you'll need to use relative links only. Also remember to upload the images to your server and check that file names match your code. At the moment, none of your referenced images appear to be uploaded to the locations you specified, which are as follows;
http://www.xsitetest.com/Images/image1.jpg
http://www.xsitetest.com/Images/Rat.jpg or
http://www.xsitetest.com/photo3.jpg

The URLs that you have used in the images arrays need to be encased in quotes - so;
myimages[0]=["/Images/image1.jpg", "http://www.xsitetest.com/Chrustmaster.html", "_Blank"]rather than;

myimages[0]=["/Images/image1.jpg", http://www.xsitetest.com/Chrustmaster.html, "_Blank"]

Also, I think you are confused as to what the URL is for - that is a hyperlink option that will allow the user to click an image and be taked to the referenced page. In your arrays, the visitor will click the first 2 images and be taken to your http://www.xsitetest.com/Chrustmaster.html page. The 3rd image will take them to http://www.javascriptkit.com. This URL isnt to make the slideshow appear on the referenced page, which is how your post appears to read.

2) - The javascript file must also be in the location you reference via the script call in the HEAD, either using an absolute or relative link. You have used http://www.xsitetest.com/dropinslideshow.js - this path is pointing to the root of your website and not in the 'Images' folder as you suggested. The script should be uploaded to the root of your site to match this existing path but you could change it to http://www.xsitetest.com/Images/dropinslideshow.js and upload it to your 'Images' folder instead.

Hope that helps

Stuatnt
06-16-2011, 08:48 AM
Beverley,

Firstly many thanks for the information, and you're right I did confuse the options.

Secondly apologies for not including the link to the script I'll post in future.

Having just tried what you have suggested it works fine and I can now see the end results.

Thanks for you prompt repsonse.

Stuart