PDA

View Full Version : html/java help


jon_hill987
09-30-2005, 11:20 AM
Ok, I'm doing the company website at work (it isn't exactly in my job description but they don't really wan't to get someone in to do it and i said I could)

Anyway, i decided that it would be nice to have pictures running like a slideshow on it.

This wasn't a problem, i did a search and came up with the folowing

http://www.cryer.co.uk/resources/javascript/script12slideshow.htm

The scipt works nicely and I don't really wan't to change it. The problem is, that I need each picture to have a different link on it.

Does anyone know how to do that?

Also that page says If this script were to be used in a number of pages then it might be best included in a separate script file instead of being embedded directly in a web page.

How would i go about doing that?

coupes.
09-30-2005, 06:59 PM
Check out the code I made, you shouldn't have a problem understanding and modifing it.

BTW, Java and Javascript are two completely different thing... ;)

Samuel Dravis
09-30-2005, 07:48 PM
Don't really have time to look at it right now, but this (http://cross-browser.com/toys/img_gallery_2.php) might be useful to you..

jon_hill987
10-01-2005, 11:00 AM
Check out the code I made, you shouldn't have a problem understanding and modifing it.

BTW, Java and Javascript are two completely different thing... ;)

Thanx, Ill have a look at that, and as for not knowing the difference... That's why I am a n00b.

Don't really have time to look at it right now, but this might be useful to you..

Will take a look now.

Thanx for the help.

@coupes, could you explain this line in some more detail for me

document.getElementById("divBannerRotation").innerHTML = unescape("<a href='" + this.links[0] + "' target='_blank'><img src='" + this.images[0] + "' width='" + this.width + "' height='" + this.height + "' border=0></a>");

I wan't to add some of the features of the other slide show in such as the fade and precaching, and it was this line that it was put into the other script.

jon_hill987
10-04-2005, 09:53 AM
Ok, I changed this part of your script:

function rotation() {

document.getElementById("divBannerRotation").style.filter="blendTrans(duration=2)";
document.getElementById("divBannerRotation").filters.blendTrans.Apply();


document.getElementById("divBannerRotation").innerHTML = unescape("<a href='" + this.links[0] + "' target='_blank'><img src='" + this.images[0] + "' width='" + this.width + "' height='" + this.height + "' border=0></a>");

document.getElementById("divBannerRotation").filters.blendTrans.Play();


// the 1st is removed and placed at the end of the list
whichLink = this.links[0];
this.links.splice(0,1);
this.links.push(whichLink);

whichImages = this.images[0];
this.images.splice(0,1);
this.images.push(whichImages);

obj = this;

setTimeout('obj.rotate()',2000);
}

To try to get the crossfade to work but it changes nothing, what am I missing?

ChAiNz.2da
10-04-2005, 10:57 AM
To try to get the crossfade to work but it changes nothing, what am I missing?
Are you trying to view this in Firefox? HTML (java) Page Transitions tend to only work in IE (yet more standards that MS has given the finger to)...so I wonder if banner transitions work the same? :confused:

My site uses page transition effects, but only IE users will actually see it. I'm on Firefox, so I can't even enjoy my own work :xp:

jon_hill987
10-04-2005, 11:12 AM
Are you trying to view this in Firefox? HTML (java) Page Transitions tend to only work in IE (yet more standards that MS has given the finger to)...so I wonder if banner transitions work the same? :confused:

My site uses page transition effects, but only IE users will actually see it. I'm on Firefox, so I can't even enjoy my own work :xp:

No, I'm at work so am using IE.

coupes.
10-04-2005, 09:35 PM
@coupes, could you explain this line in some more detail for me
document.getElementById("divBannerRotation").innerHTML = unescape("<a href='" + this.links[0] + "' target='_blank'><img src='" + this.images[0] + "' width='" + this.width + "' height='" + this.height + "' border=0></a>");

Basically, what this line does is retreive the element with the id "divBannerRotation" (a div element in our case) and changes it's contents using the first element of the "links" list as the link (this.links[0]) and the first element of the "images" list as the images (this.images[0]).

Then, the firs element of either list is removed and placed at the end of the list, so the next time the function is called, the content of the "divBannerRotation" element will be different.

jon_hill987
10-11-2005, 06:46 AM
Well, it seems that the blend dosn't work with the script you provided, thanx anyway.

I found another script which works (it used captions instead of having the image as a link) so all is good except when i checked it in other browsers.

IE: fine
Firefox: no fade but still works
Opera:
Event thread: load
Error:
name: TypeError
message: Statement on line 64: Could not convert undefined or null to object
Backtrace:
Line 64 of inline#1 script in http://www.ics-robotics.co.uk/case0.htm
document.images.PictureBox.filters.blendTrans.Appl y();
Line 1 of script
runSlideShow();
At unknown location
[statement source code not available]


i don't think it is too big a problem as not many business PC's will use Opera, but if anyone can help me sort it it would be good.

the page is www.ics-robotics.co.uk/case0.htm

Also if someone with a mac can tell me what the page looks like it would be helpfull.

Cheers.