Results 1 to 3 of 3

Thread: Links in Blending Image Slideshow Script

  1. #1
    Join Date
    Oct 2005
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Links in Blending Image Slideshow Script

    Blending Image Slideshow Script
    http://www.dynamicdrive.com/dynamicindex14/image4.htm

    Greetings all. I am very much a js newbie, and have a problem that others may be able to solve with very little effort.

    I am using the Blending image Slideshow Script on my site. I need to be able to change the
    Code:
    newwindow
    value according to the image being displayed. So in some cases I would like to open the link in a new window, in others i would like the link to open in the current window.

    I thought that simply setting the
    Code:
    newwindow
    value as an array:
    Code:
    var newwindow=new Array("0", "1")
    would work, but have found Im off base.

    I did some forum searching and didnt see any similar threads...any help would be greatly appreicated.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    In other words, you're looking for selective link targeting for each image within the slideshow. Sure, simply replace the script of code 1 with the below instead:

    Code:
    <script language="JavaScript1.1">
    <!--
    
    //*****************************************
    // Blending Image Slide Show Script- 
    // © Dynamic Drive (www.dynamicdrive.com)
    // For full source code, visit http://www.dynamicdrive.com/
    //*****************************************
    
    //specify interval between slide (in mili seconds)
    var slidespeed=3000
    
    //specify images
    var slideimages=new Array("test.gif","image2.gif","image3.gif")
    
    //specify link target for each image
    var linktargets=new Array("", "_new", "_new")
    
    //specify corresponding links
    var slidelinks=new Array("http://www.google.com","http://yahoo.com","http://www.cnn.com")
    
    
    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 (linktargets[whichlink]!="")
    window.open(slidelinks[whichlink], linktargets[whichlink])
    else
    window.location=slidelinks[whichlink]
    }
    
    //-->
    </script>
    Customize "var linktargets".

  3. #3
    Join Date
    Oct 2005
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Worked like a charm. Thanks so much for your help.

Bookmarks

Posting Permissions

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