PDA

View Full Version : Help with ultimate slideshow



boogyman
01-24-2008, 09:56 PM
1) Script Title: Ultimate Slide Show

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:
error: fadeshow is not defined



<script src="/js/ultimate.js" type="text/javascript">
</script>

is the correct location to the slideshow script.



<script type="text/javascript">
var vutekSlides = new Array();
vutekSlides[1] = ["/images/dashboard/150.jpg","",""];
vutekSlides[2] = ["/images/dashboard/200.jpg","",""];
vutekSlides[3] = ["/images/dashboard/3360.jpg","",""];
vutekSlides[4] = ["/images/dashboard/3200","",""];
vutekSlides[5] = ["/images/dashboard/5330.jpg","",""];

new fadeshow(vutekSlides, 300, 164, 0, 3000, 1);
</script>


The above code is where the slideshow is supposed to show up. I am dynamically writing the array from a database which is why it is why I took it out of the regular script, the output shown above.
For the sake of trying to get it working I also tried using and exact demo of your script but it still gives me fadeshow undefined.

The image urls and the url to the script are both correct, and double checked.
Unfortunately the site is password protected due to proprietary information, however I can give you a temp name / password if you would like.

thetestingsite
01-24-2008, 10:11 PM
I am not experiencing this issue on the demo page (the one you linked to), and also not on another test page I created. Do you have a link to your problem page so that we can see what's going on with it?

boogyman
01-24-2008, 10:34 PM
Yes I do but it is password protected, which I put in the post. I will PM you now with the credentials.

jscheuer1
01-24-2008, 10:42 PM
Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

The main script creates fadeshow:



/***********************************************
* Ultimate Fade-In Slideshow (v1.51): Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["pho . . .

. . . olor="white"

////NO need to edit beyond here/////////////

var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers

var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all

function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 / . . .

If fadeshow is not defined, the script is missing or there is a syntax error.

I see you are using the main script externally, make sure you are following these guidelines:


Use a text editor to save the script, call it 'file_name.js' where 'file_name' can be any valid file name of your choosing. Substitute the name of your external .js file for some.js in the below:


<script src="some.js" type="text/javascript"></script>

Common problems arise when:

1 ) The script file is not in the directory specified. In the above example it must be in the same directory as the page(s) that use it. Below, it can be in the scripts directory off of the root of a domain:


<script src="http://www.somedomain.com/scripts/some.js" type="text/javascript"></script>

2 ) Opening, closing and/or 'hiding' tags are left in the external file. This means that you must strip:
<script>
<!--and
//-->
</script>and any of their many variations from the beginning and end of the external file.

3 ) The external call (<script src="some.js" type="text/javascript"></script>) is not inserted into the page at the correct spot. The external call must be inserted at the same place on the page where the script was/would have been.

4 ) Paths to other files (if) used by the script are no longer valid due to its location. This is only a problem if the external script is kept in a different directory than the page it was working on when it was an internal script. To correct this, use absolute paths inside the script. Absolute path examples:


http://www.somedomain.com/images/button.gif

http://www.somedomain.com/~mysitename/index.html

5 ) Inappropriately combining two or more scripts into one external file. Usually external scripts can be combined if one knows enough about scripting to do so properly. Even then it is possible to overlook something.

A rule of thumb when testing is, if it won't work on the page, it won't work as an external file either.

One other thing, if this is a DD script or any script that requires the credit remain for legal use, include the credit in the on page call, ex:


<script src="some.js" type="text/javascript">
/***********************************************
* IFrame SSI script II- Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>

Make sure to retain all the 'decorations', as these include begin and end javascript comment delimiters, without which the script won't function.

There is also info here:

http://www.javascriptkit.com/javatutors/external.shtml

boogyman
01-24-2008, 10:55 PM
John how can you tell its in violation? you dont even know the website? I copied directly from the demo page.

In any event I copied the disclaimer to the physical location...



<script type="text/javascript">
<!--
/***********************************************
* Ultimate Fade-In Slideshow (v1.51): � Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var vutekSlides = new Array();
vutekSlides[0] = ["/images/dashboard/5330.jpg","",""];
vutekSlides[1] = ["/images/dashboard/150.jpg","",""];
vutekSlides[2] = ["/images/dashboard/200.jpg","",""];
vutekSlides[3] = ["/images/dashboard/3360.jpg","",""];
vutekSlides[4] = ["/images/dashboard/3200","",""];
new fadeshow(vutekSlides, 300, 164, 0, 3000, 1);
// -->
</script>

Thanks for your help testing


Sorry for the violation :-? ... does that fix it?

jscheuer1
01-24-2008, 11:19 PM
I just took you literally when you said you had:





<script src="/js/ultimate.js" type="text/javascript">
</script>




<script type="text/javascript">
var vutekSlides = new Array();
vutekSlides[1] = ["/images/dashboard/150.jpg","",""];
vutekSlides[2] = ["/images/dashboard/200.jpg","",""];
vutekSlides[3] = ["/images/dashboard/3360.jpg","",""];
vutekSlides[4] = ["/images/dashboard/3200","",""];
vutekSlides[5] = ["/images/dashboard/5330.jpg","",""];

new fadeshow(vutekSlides, 300, 164, 0, 3000, 1);
</script>


The credit should go here:



<script src="/js/ultimate.js" type="text/javascript">

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

</script>


But where you have it is acceptable.

Any luck fixing the problem yet?

thetestingsite
01-24-2008, 11:27 PM
Any luck fixing the problem yet?


Yes, the problem was due to a couple of things. First being the <script> tags and comment tags in the js file (causing the fadeshow function not to exist). Second being the slideshow array started with a 1 instead of a 0 (thus throwing out an error saying theimages[p] is not defined). Fixed those items and the slideshow worked perfectly.