Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    increment preload image open new window?

    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

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    this will return to the last viewed image

    Code:
        <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>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    That worked!

    You are a genius, my friend. Thank you from all 147 big cats at Big Cat Rescue.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •