Results 1 to 3 of 3

Thread: Help adding hyperlink to existing slideshow

  1. #1
    Join Date
    Sep 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help adding hyperlink to existing slideshow

    Hello all,

    I was hoping you could help me with this script. It loads a pic with a text description, but I've been trying to add a hyperlink for either the pic or the text, or both, to no avail.
    Could you take a look and advise, please?
    As you can see, I've used ASP to populate the java arrays - I tried to set that code apart in blue. I have also disabled the buttons - I'd rather have it play automatically.
    Any help is appreciated.
    Thanks,
    Carrie

    <script language="JavaScript1.2">

    /*
    Interactive Image slideshow with text description
    By Christian Carlessi Salvadó (cocolinks@c.net.gt). Keep this notice intact.
    Visit http://www.dynamicdrive.com for script
    */


    g_fPlayMode = 0;
    g_iimg = -1;
    g_imax = 0;
    g_ImageTable = new Array();

    function ChangeImage(fFwd)
    {
    if (fFwd)
    {
    if (++g_iimg==g_imax)
    g_iimg=0;
    }
    else
    {
    if (g_iimg==0)
    g_iimg=g_imax;
    g_iimg--;
    }
    Update();
    }

    function getobject(obj){
    if (document.getElementById)
    return document.getElementById(obj)
    else if (document.all)
    return document.all[obj]
    }

    function Update(){
    getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
    getobject("_Ath_FileName").innerHTML = g_ImageTable[g_iimg][1];
    //getobject("_Ath_LinkName").innerHTML = g_ImageTable[g_iimg][2];
    getobject("_Ath_Img_X").innerHTML = g_iimg + 1;
    getobject("_Ath_Img_N").innerHTML = g_imax;
    }


    function Play()
    {
    g_fPlayMode = !g_fPlayMode;
    if (g_fPlayMode)
    {
    getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
    Next();
    }
    else
    {
    getobject("btnPrev").disabled = getobject("btnNext").disabled = false;

    }
    }
    function OnImgLoad()
    {
    if (g_fPlayMode)
    window.setTimeout("Tick()", g_dwTimeOutSec*1500);
    }
    function Tick()
    {
    if (g_fPlayMode)
    Next();
    }
    function Prev()
    {
    ChangeImage(false);
    }
    function Next()
    {
    ChangeImage(true);
    }

    ////configure below variables/////////////////////////////


    <% Dim rndMax
    rndMax = CInt(RS.RecordCount)
    'response.write rndMax & "<br>"
    RS.MoveFirst

    ''''''''''''''Pull Random Records
    Dim imgArr(6,5)
    For i = 0 to 5
    Randomize Timer
    Dim rndNumber
    rndNumber = Int(RND * rndMax)
    'response.write rndNumber & "<br>"
    RS.Move rndNumber
    If RS.EOF then
    RS.MoveFirst
    RS.Move rndNumber
    End If
    'response.write i
    imgArr(i,0) = RS("Property_ID")
    imgArr(i,1) = RS("Bedrooms")
    imgArr(i,2) = RS("Baths")
    imgArr(i,3) = RS("Address")
    imgArr(i,4) = RS("City") %>

    //generate the next lines for pics
    g_ImageTable[g_imax++] = new Array ("pics/<%=imgArr(i,0)%>l-1.jpg", "<%=imgArr(i,3)%>, <%=imgArr(i,4)%>");
    //finish asp loop
    Next %>
    g_dwTimeOutSec=2

    ////End configuration/////////////////////////////

    if (document.getElementById||document.all)
    window.onload=Play

    </script>


    <p align="center"><img id="_Ath_Slide" onload="OnImgLoad()"></a> </p>

    <p align="center"><a href="details.asp?ID=<% response.write imgArr(0,0)%>"><SPAN id="_Ath_FileName"> </SPAN></a><br>
    </p>

  2. #2
    Join Date
    Sep 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Anybody?

    Does anybody know what I can do to add a hyperlink to this script?

    Carrie

  3. #3
    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

    I wrote my own, become a beta tester!
    - 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
  •