croakingtoad
03-31-2003, 08:03 AM
Okay, below you'll see a javascript that I have but I need it modified slightly. You can see what this script does by visiting http://www.croakingtoad.com/templates.shtml.
When you click the displayed thumbnail image, it opens the matching full-size image in the browser window.
What I want it to do, is open first of all in a new window. I also want more control over that window by javascript. Something like: window.open("photoslink[which]","new_window","scrollbars,resizable");
I don't know if that above syntax is 'exactly' right, but you probably get the idea... Can somebody take a look at the javascript as is and suggest how to get it to perform the above? Thanks!
Here it is:
<script language="JavaScript1.1">
/*
DHTML slideshow script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
var photos=new Array()
var photoslink=new Array()
var which=0
//define images. You can have as many as you want. Images MUST be of the same dimensions (for NS's sake)
photos[0]="/templates/thumbs/spx1_thumb.jpg"
photos[1]="/templates/thumbs/spx2_thumb.jpg"
photos[2]="/templates/thumbs/spx3_thumb.jpg"
photos[3]="/templates/thumbs/spx4_thumb.gif"
photos[4]="/templates/thumbs/spx5_thumb.gif"
//Specify whether images should be linked or not (1=linked)
var linkornot=1
//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]="/templates/spx1.jpg"
photoslink[1]="/templates/spx2.jpg"
photoslink[2]="/templates/spx3.jpg"
photoslink[3]=""
photoslink[4]=""
//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.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}
function playeffect(){
if (document.all)
photoslider.filters.revealTrans.play()
}
function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}
function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
function transport(){
window.location=photoslink[which]
}
</script>
When you click the displayed thumbnail image, it opens the matching full-size image in the browser window.
What I want it to do, is open first of all in a new window. I also want more control over that window by javascript. Something like: window.open("photoslink[which]","new_window","scrollbars,resizable");
I don't know if that above syntax is 'exactly' right, but you probably get the idea... Can somebody take a look at the javascript as is and suggest how to get it to perform the above? Thanks!
Here it is:
<script language="JavaScript1.1">
/*
DHTML slideshow script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
var photos=new Array()
var photoslink=new Array()
var which=0
//define images. You can have as many as you want. Images MUST be of the same dimensions (for NS's sake)
photos[0]="/templates/thumbs/spx1_thumb.jpg"
photos[1]="/templates/thumbs/spx2_thumb.jpg"
photos[2]="/templates/thumbs/spx3_thumb.jpg"
photos[3]="/templates/thumbs/spx4_thumb.gif"
photos[4]="/templates/thumbs/spx5_thumb.gif"
//Specify whether images should be linked or not (1=linked)
var linkornot=1
//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]="/templates/spx1.jpg"
photoslink[1]="/templates/spx2.jpg"
photoslink[2]="/templates/spx3.jpg"
photoslink[3]=""
photoslink[4]=""
//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.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}
function playeffect(){
if (document.all)
photoslider.filters.revealTrans.play()
}
function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}
function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
function transport(){
window.location=photoslink[which]
}
</script>
