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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add Target tag to Slideshow to accomodate Frame ID

    I'm looking to use this script to link from the picture slidshow to a thumbnail view, I have it working on the individual .html page, however am calling it in a frameset. I've tried appending a target tag into the gotoshow function but apparently am not doing something right. Is there any way to manipulate this code to accomodate living within frames? The frame ID where the main content lives is "right" so the target command in HTML ends up target="right".

    Here is the code. Please let me know if I can provide any further information to help in troubleshooting. I have the code hosted if you need the link.

    Thanks in advance - Stowt

    <head>
    <script language="JavaScript1.1">
    <!--

    //specify interval between slide (in mili seconds)
    var slidespeed=3000

    //specify images
    var slideimages=new Array("pic1.jpg","pic2.jpg","pic3.jpg")

    //specify corresponding links
    var slidelinks=new Array("link1.html", "link2.html", "link3.html")

    var newwindow=0 //open links in new window? 1=yes, 0=no

    var imageholder=new Array()
    var ie=document.all
    for (i=0;i<slideimages.length;i++){
    imageholder[i]=new Image()
    imageholder[i].src=slideimages[i]
    }

    function gotoshow(){
    if (newwindow)
    window.open(slidelinks[whichlink])
    else
    window.location=slidelinks[whichlink]
    }

    //-->
    </script>

    </head>
    <body>
    <a href="javascript:gotoshow()"><img src="pic1.jpg" name="slide" border="0" style="filter:blendTrans(duration=3)" width="260" height="198"></a>

    <script language="JavaScript1.1">
    <!--

    var whichlink=0
    var whichimage=0
    var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
    function slideit(){
    if (!document.images) return
    if (ie) document.images.slide.filters[0].apply()
    document.images.slide.src=imageholder[whichimage].src
    if (ie) document.images.slide.filters[0].play()
    whichlink=whichimage
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    setTimeout("slideit()",slidespeed+blenddelay)
    }
    slideit()

    //-->
    </script>
    </body>

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,471
    Thanks
    0
    Thanked 634 Times in 624 Posts
    You may want to replace

    window.location=slidelinks[whichlink]


    with

    window.location=right.slidelinks[whichlink]
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the follow up!

    I went and tried to make the update, however I get an error on the page upon clicking that states "'right' is undefined".

    I'm beginning to think that maybe I should rewrite their site to remove the framesets and just make it a simple table instead...

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,467
    Thanks
    3
    Thanked 495 Times in 482 Posts
    window.top.right.location=slidelinks[whichlink]
    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/

  • #5
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked perfect VWPhillips!

    Thanks to both of you for your replies and help


  •  

    Posting Permissions

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