I have developed a simple javascript slideshow that works pretty well. The only thing is that the client would like to have the second 'slide' actually play a movie.
I've got the exception generated - but the movie opens in a new window. How do I get it to open in the current window? I suspect it has to do with setting the window or self property - but I'm not sure how or where to do that.
Here's the code that I have thus far:
Code: Select all
<script type="text/javascript">
var photos=new Array()
var photoslink=new Array()
var which=1
//define images. You can have as many as you want:
photosї1]="images/ir1.jpg"
photosї2]="images/ir2.jpg"
photosї3]="images/ir3.jpg"
photosї4]="images/ir4.jpg"
photosї5]="images/ir5.jpg"
photosї6]='images/ir6.jpg';
photosї7]='images/ir7.jpg';
photosї8]='images/ir8.jpg';
photosї9]='images/ir9.jpg';
photosї10]='images/ir10.jpg';
photosї11]='images/ir11.jpg';
photosї12]='images/ir12.jpg';
photosї13]='images/ir13.jpg';
photosї14]='images/ir14.jpg';
photosї15]='images/ir15.jpg';
photosї16]='images/ir16.jpg';
photosї17]='images/ir17.jpg';
photosї18]='images/ir18.jpg';
photosї19]='images/ir19.jpg';
photosї20]='images/ir20.jpg';
photosї21]='images/ir21.jpg';
photosї22]='images/ir22.jpg';
photosї23]='images/ir23.jpg';
photosї24]='images/ir24.jpg';
photosї25]='images/ir25.jpg';
photosї26]='images/ir26.jpg';
photosї27]='images/ir27.jpg';
photosї28]='images/ir28.jpg';
photosї29]='images/ir29.jpg';
photosї30]='images/ir30.jpg';
photosї31]='images/ir31.jpg';
photosї32]='images/ir32.jpg';
photosї33]='images/ir33.jpg';
photosї34]='images/ir34.jpg';
photosї35]='images/ir35.jpg';
photosї36]='images/ir36.jpg';
photosї37]='images/ir37.jpg';
photosї38]='images/ir38.jpg';
photosї39]='images/ir39.jpg';
//Specify whether images should be linked or not (1=linked)
var linkornot=0
//do NOT edit pass this line
var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimagesїi]=new Image()
preloadedimagesїi].src=photosїi]
}
function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition = 7
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}
function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}
function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}
function backward(){
if(which==0) which =photos.length-1
if (which>1){
which--
if (which == 2)
showMovie()
else
applyeffect()
document.images.photoslider.src=photosїwhich]
playeffect()
keeptrack()
}
}
function forward(){
if(which>photos.length-1) which = 0
if (which<photos.length-1){
which++
if (which == 2)
showMovie()
else
applyeffect()
document.images.photoslider.src=photosїwhich]
playeffect()
keeptrack()
}
}
function photoNum(num){
which = num
if (which == 2)
showMovie()
else
applyeffect()
document.images.photoslider.src=photosїwhich]
playeffect()
keeptrack()
}
function transport(){
window.location=photoslinkїwhich]
}
</script>Code: Select all
<script>
function showMovie()
{
document.write('<EMBED src="images/video.mov" border="0" width="700" autoplay="true" scale="Aspect" pluginspage="http://www.apple.com/quicktime/download/" height="491" target="webbrowser" controller="true"></EMBED>')
} document.write('<img src="'+photosї1]+'" name="photoslider" style="filter:revealTrans(duration=2,transition=12)" border=0>')
</script>