...

View Full Version : increment preload image open new window?



BigCatRescue
12-10-2007, 03:09 PM
In addition to being blonde and female, I have virtually NO understanding of java script, other than it is magic and I love it. I have a working version of the increment preload image script at http://www.bigcatrescue.org/cats/captive/tigers.htm but what I want to do is have the clicked images open a new window so that the page above continues to scroll. Otherwise, when someone clicks and sees the linked page, upon returning they have to sit through the entire array again to get to the next tiger on the list.

Is there a way to modify the code to do that? I have tried inserting target = blank in several places, but none of them have been the right place. The code is below:
======================================
<SCRIPT LANGUAGE="JavaScript">
<!--

/*
Script by FPMC at http://jsarchive.8m.com
Submitted to JavaScript Kit (http://javascriptkit.com)
For this and 400+ free scripts, visit http://javascriptkit.com
*/

//set image paths

src = [
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerShereKhanOnLog.jpg",
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerChinaDollLake.jpg",
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerauroara.jpg",
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerbellahappygrass.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerTJsinging.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigermodnicredball.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigertrucha.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerBengalliwBall.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerCrazyBuffy.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerFLAVIO.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerIndia.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerKing3.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerNalaSleep.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerNarak.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/PrincessTiger.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerSarmontiwBall.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerSnorkelPool.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/WhiteTigers/whitetiger03a.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerNikita.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerSimba.jpg"
]

//set corresponding urls

url = [
"http://bigcatrescue.org/cats/captive/tigerssherekhan.htm",
"http://bigcatrescue.org/cats/captive/tigerschinadoll.htm",
"http://bigcatrescue.org/cats/captive/tigersauroara.htm",
"http://bigcatrescue.org/cats/captive/tigersbella.htm",
"http://bigcatrescue.org/cats/captive/tigerstj.htm",
"http://bigcatrescue.org/cats/captive/tigersmodnic.htm",
"http://bigcatrescue.org/cats/captive/tigerstrucha.htm",
"http://bigcatrescue.org/cats/captive/tigersbengali.htm",
"http://bigcatrescue.org/cats/captive/tigersbuffy.htm",
"http://bigcatrescue.org/cats/captive/tigersflavio.htm",
"http://bigcatrescue.org/cats/captive/tigersindia.htm",
"http://bigcatrescue.org/cats/captive/tigersking.htm",
"http://bigcatrescue.org/cats/captive/tigersnala.htm",
"http://bigcatrescue.org/cats/captive/tigersnarak.htm",
"http://bigcatrescue.org/cats/captive/tigersprincess.htm",
"http://bigcatrescue.org/cats/captive/tigerssarmoti.htm",
"http://bigcatrescue.org/cats/captive/tigerssnorkle.htm",
"http://bigcatrescue.org/cats/captive/tigerszabu.htm",
"http://bigcatrescue.org/cats/captive/tigersnikita.htm",
"http://bigcatrescue.org/cats/captive/tigerssimba.htm",
]
//set duration for each image
duration = 4;

//Please do not edit below
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*1000);
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<A HREF="javascript:doLink();" onMouseOver="status=url[ct];return true;"
onMouseOut="status=''">
<IMG NAME="Ad_Image" SRC="image1.gif" BORDER=0>
</A>,</div>
==============================================

Thank you, and if you could answer in English, preferrably, my slow southern drawl, it would help me understand.

Carole Baskin, Founder of Big Cat Rescue

vwphillips
12-10-2007, 04:57 PM
this will return to the last viewed image


<SCRIPT LANGUAGE="JavaScript">
<!--

/*
Script by FPMC at http://jsarchive.8m.com
Submitted to JavaScript Kit (http://javascriptkit.com)
For this and 400+ free scripts, visit http://javascriptkit.com
*/

//set image paths

var src = [
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerShereKhanOnLog.jpg",
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerChinaDollLake.jpg",
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerauroara.jpg",
"http://www.bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerbellahappygrass.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerTJsinging.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigermodnicredball.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigertrucha.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerBengalliwBall.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerCrazyBuffy.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerFLAVIO.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerIndia.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerKing3.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerNalaSleep.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerNarak.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/PrincessTiger.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/tigerSarmontiwBall.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerSnorkelPool.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/WhiteTigers/whitetiger03a.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerNikita.jpg",
"http://bigcatrescue.org/images/000BigCatPhotos/TigerPhotos/TigerSimba.jpg"
]

//set corresponding urls

var url = [
"http://bigcatrescue.org/cats/captive/tigerssherekhan.htm",
"http://bigcatrescue.org/cats/captive/tigerschinadoll.htm",
"http://bigcatrescue.org/cats/captive/tigersauroara.htm",
"http://bigcatrescue.org/cats/captive/tigersbella.htm",
"http://bigcatrescue.org/cats/captive/tigerstj.htm",
"http://bigcatrescue.org/cats/captive/tigersmodnic.htm",
"http://bigcatrescue.org/cats/captive/tigerstrucha.htm",
"http://bigcatrescue.org/cats/captive/tigersbengali.htm",
"http://bigcatrescue.org/cats/captive/tigersbuffy.htm",
"http://bigcatrescue.org/cats/captive/tigersflavio.htm",
"http://bigcatrescue.org/cats/captive/tigersindia.htm",
"http://bigcatrescue.org/cats/captive/tigersking.htm",
"http://bigcatrescue.org/cats/captive/tigersnala.htm",
"http://bigcatrescue.org/cats/captive/tigersnarak.htm",
"http://bigcatrescue.org/cats/captive/tigersprincess.htm",
"http://bigcatrescue.org/cats/captive/tigerssarmoti.htm",
"http://bigcatrescue.org/cats/captive/tigerssnorkle.htm",
"http://bigcatrescue.org/cats/captive/tigerszabu.htm",
"http://bigcatrescue.org/cats/captive/tigersnikita.htm",
"http://bigcatrescue.org/cats/captive/tigerssimba.htm",
]
//set duration for each image
var duration = 4;

//Please do not edit below
var ads=[],ct=0,zxcTO;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
zxcSetCookie(ct);
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
zxcTO=setTimeout("switchAd()",duration*1000);
}

function doLink(){
clearTimeout(zxcTO)
location.href = url[ct];
}

onload = function(){
if (document.images) zxcCookieStart();
}
//-->
</SCRIPT>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

var zxcDays=1; // The cookie will be available on revisits for a specified number of days
var zxcCookie='My Form'; // The Cookie name

var zxcExp=new Date(new Date().getTime()+zxcDays*86400000).toGMTString();

function zxcGetCookie(name) {
var zxcst=document.cookie.indexOf(name+"=");
var zxclen=zxcst+name.length+1;
if ((!zxcst)&&(name != document.cookie.substring(0,name.length))) return null;
if (zxcst==-1) return null;
var zxcend=document.cookie.indexOf(";",zxclen);
if (zxcend==-1) zxcend=document.cookie.length;
return decodeURI(document.cookie.substring(zxclen,zxcend));
}

function zxcSetCookie(zxcvalue){
document.cookie=zxcCookie+"="+encodeURI(zxcvalue)+";expires="+zxcExp+";path=/;"
}

function zxcCookieStart(){
if (zxcGetCookie(zxcCookie)){
ct=zxcGetCookie(zxcCookie)*1;
}
switchAd();
}

/*]]>*/
</script>

BigCatRescue
12-10-2007, 06:39 PM
You are a genius, my friend. Thank you from all 147 big cats at Big Cat Rescue.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum