Need help with a javascript slideshow i have code for

Hello,I have a bit of javascript code to put on a page that I am having some trouble with. Its a pretty clean bit of code, I have put its parts in the appropriate spots in domino form but there’ one part I think I am having problems with… where it needs to get the images… You’ll see in the code that it has made an array and populates the array with ‘1.jpg’ (see below) and so on. when I try to use this code I get a javascript error with an object expected in it. My thoughts are that I need to make domino uderstand where the pics are. I have tried using image resources and calling appropriatetly and varioius other things. I would be ever greatful if I could get someone who understands this better to take a look. Here is the code I have…

Any help is appreciated (except redicule)

===========================================================

Script: JavaScript Cross-Browser SlideShow Script

      With Cross-Fade Effect between Images

      Adjustable Timing and Unlimited Images

Function: Displays images continuously in a slideshow

      presentation format, with a fade effect on

      image transitions.

Browsers: All common browsers: NS3-6, IE 4-6

      Fade effect only in IE; others degrade gracefully

Author: etLux

===========================================================

Step 1.

Put the following script in the head of your page:

===========================================================

Step 2.

Put this onload event call in your body tag:

===========================================================

Step 3.

Put this in the body of your page where you want the

slide show to appear.

Set widths and heights same as images

Set image file same as first image in array Pic (above)

===========================================================

Subject: need help with a javascript slideshow i have code for…

I believe you will find that the issue is as you suspect, the location of the image files, but before deciding where to put these files you need to decide if they are to be managed by the user when they change or not.

If they are, then use a view and create a form to hold the images, that way the user can access the images to change them or remove them.

Otherwise use the Image Resource.

What I would do is right-click on the image area that doesn’t show the image and select properties to see what the URL is and you should then be able to locate the correct starting URL for the images, e.g. after the .nsf/ for the Image Resource and viewname/documentidentifier/$File/…

Ensure that the image URL points the the correct place.

The try replacing the IMG in Step 3 to show ‘/1.jpg’, again checking the URL of the image to see where it is, as you might need to replace the file path of the database, as the ‘/’ might take you back to the server.

Subject: RE: need help with a javascript slideshow i have code for…

This one has me baffled… in the code I put in the Body, the image shows up ok but not getting anything but error calling the images the same way in the javascript array. Cant figure out any way to debug it either. It doesnt even try to bring in the image. I only get a “object expected” error right off. I have tried a dozen ways to put a path for the images. Eventually I want to call images from doc in the db but just trying to get them with the basic way first. ‘…/1.jpg?OpenImageResource’ Is there some swithches in the form or database that need to be set to do this?? I’m kinda new with arm wrestling R6. It has quirks, wondering if this is one of them.Has anyone gotten something like this to work in R6?? I tried another code here in the forum for slideshow and it does the same thing…

Subject: I’d be interested to see if anyone can get this to work…it should but…

I have tried 5 different javascript scripts for slideshows. This ones not too bad. If someone who is brilliant in javascript can make it work then I’d say that R6 is ok but until then I question R6… I’ve run into other quirks that are specific to R6.Would anyone like to try it and see if its just me? I’d rather be wrong than be working with a defective product…

Thanks

Subject: RE: I’d be interested to see if anyone can get this to work…it should but…

Works no problem at all. Try using absolute URLs for the images. Create this computed value:

“http://” + @GetHTTPHeader(“Host”) + “/” + @WebDbName + “/”

and put that before the image name in the Pic array load values if you are using Image Resources.

Again, it’s not ND6 – it’s having an understanding of Domino URLs.

Subject: RE: I’d be interested to see if anyone can get this to work…it should but…

Thanks again Stan. You help is greatly appreciated.

Subject: RE: I’d be interested to see if anyone can get this to work…it should but…

I always hate to ask the next question. I’m not an expert on javascript.Can you give me a hint as to how to incorporate that. I’ve had no luck with getting it into the javascript. Where I defined it in a field on the form keeps javascript erroring out saying that the field name is undefined.

PS are there any good books that describe well the mix of javascript and domino. I typically find either a domino book or a javascript but they never show working together with them. I have actually done quite a bit but stumble on mixing things like this code into javascript. It probably simple but instead of whacking my head all day trying differnt things (which I have been doing)

regards

Subject: RE: I’d be interested to see if anyone can get this to work…it should but…

Apart from the Lotus Notes and Domino 6 Programmer’s Bible, I don’t know of any books, per se. HOWEVER, I would suggest looking at Scott Good’s JavaScript articles in Lotus Advisor magazine (most months 2003-2004, starting January 2003).

In this case, take advantage of the fact that JavaScript never, ever has to appear in the . Put all of the JavaScript directly on the page and mark it as PassThru HTML. You can then slide the computed text directly into the JS. When the browser gets the page, the formulas will be resolved into the proper values.

Subject: RE: I’d be interested to see if anyone can get this to work…it should but…

Thanks Stan, that was the key. Just putting the whole thing in the field on the page made the difference. Then it allowed just putting the ‘…/1.jpg’ in and it worked. I didnt know about being able to put the code in the field completly like that.My gratitude

Regards