Results 1 to 2 of 2

Thread: Link only specific images in Blending Slide Show

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

    Default Link only specific images in Blending Slide Show

    1) Script Title: Blending Image Slideshow

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex14/image4.htm

    3) Describe problem:
    I have the slideshow working fine. I want to link the last image ONLY. However, on all the preceding images, it still links to a blank page. Is there a way to not have the preceding images clickable at all?

    Here are both scripts as I have them configured now:

    <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("image1.gif","stats.gif","image2.gif","image3.gif","image4.gif","image5.gif","image6.gif","image7.gif","image8.gif","image9.gif","theend.jpg")

    //specify corresponding links
    var slidelinks=new Array("","","","","","","","","","","mailto:email@comcast.net")

    var newwindow=1 //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>



    <table width="873" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="219">&nbsp;</td>
    <td width="472">
    <p align="center"><img src="transparent.gif" width="50" height="146"><a href="javascript:gotoshow()"><img src="image1.gif" name="slide" width=472 height=342 border=0 style="filter:blendTrans(duration=3)"></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>
    </p>

    </td>
    <td width="182">&nbsp;</td>
    </tr>
    </table>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Change this:

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

    Code:
    function gotoshow(){
    if(slidelinks[whichlink] == '') return;
    if (newwindow)
    window.open(slidelinks[whichlink])
    else
    window.location=slidelinks[whichlink]
    }
    With that, you may use empty items to denote no link here:

    Code:
    var slidelinks=new Array("http://www.dynamicdrive.com","","http://www.geocities.com")
    The second (of three in this case) image would have no link.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •