Results 1 to 2 of 2

Thread: Problem with Up down slideshow Script

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

    Exclamation Problem with Up down slideshow Script

    Script:
    Up Down Slideshow Script
    http://www.dynamicdrive.com/dynamici...pdownslide.htm

    Problem:
    I have been using this dynamic drive script for about 2 years...and all of a sudden, it has stopped working. I have gone through everything, line by line and can't see a problem. Can anyone tell me why it might have stopped working? Is there a .js update to this that I can't see or need?

    This is the script I'm using:
    <CFINCLUDE TEMPLATE="/Common/nocache.cfm">

    <CFPARAM Name="Counter" Default=0>
    <!---get new emp list--->
    <!--- <CFQUERY NAME="Start_list" DATASOURCE="#CALWebDataSource#">
    SELECT Emp_No, Last_name, First_Name, Nick_Name, Start_DT, Directorate, Category, Location
    FROM Employ
    WHERE Status = 'Active'
    <!--- AND Emp_No < 9000 --->
    AND Start_DT > #DateAdd('m', '-1', CreateODBCDateTime(Now()))#
    ORDER BY Start_DT DESC
    </CFQUERY> --->
    <CFQUERY NAME="Start_list" DATASOURCE="#CALWebDataSource#">
    SELECT Emp_No, Last_name, First_Name, Nick_Name, Start_DT, Directorate, Category, Location
    FROM Employ
    WHERE Status = 'Active'
    AND Start_DT > #CreateODBCDateTime(DateAdd('m', '-1', Now()))#
    ORDER BY Start_DT DESC
    </CFQUERY>


    <TABLE WIDTH="130" Height="100%" BGCOLOR="#AEC3E9" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#AEC3E9">
    <TR BGCOLOR="#AEC3E9" HEIGHT="100"><TD VALIGN="Top" ALIGN="Center" TD="#AEC3E9">
    <br><FONT SIZE="1" FACE="verdana">
    <CFIF Start_list.RecordCount GT 1>
    <script language="JavaScript1.2">

    /*
    Up down slideshow Script- Updated: 99/05/15
    By Dynamic Drive (www.dynamicdrive.com)
    For full source code, terms of use, and 100's more scripts, visit http://dynamicdrive.com
    */

    ///////configure the below four variables to change the style of the slider///////
    //set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!

    var scrollerwidth=130
    var scrollerheight=130
    var scrollerbgcolor='#AEC3E9'
    //3000 miliseconds=3 seconds
    var pausebetweenimages=3000

    //configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
    var slideimages=new Array()
    <CFOUTPUT QUERY="Start_list">
    //check to see if the photo for the emp exists by calling it outfile
    <CFSET Outfile="#ServerRootPath#\images\employee\#Emp_No#.jpg">
    slideimages[#Counter#]='<a href="/EmployeeInfo/Emp_detail.cfm?emp_no=#emp_no#"><IMG SRC="/images/employee/<CFIF FileExists(outfile) IS "Yes">#Emp_No#.jpg<CFELSE>no_photo.jpg</CFIF>" WIDTH=75 HEIGHT=102 BORDER=0 ALT="Photo of #Nick_name# #Last_name#"><br>#Nick_Name# #Last_name#</A><BR>'
    <CFSET Counter=Counter+1>
    </CFOUTPUT>

    //Since we need at least 3 images always rotating, if the query returns less than 3 records we need to recycle the pics again or the script won't work
    <CFIF Start_list.RecordCount LT 3>
    <CFOUTPUT QUERY="Start_list">
    <CFSET Outfile="#ServerRootPath#\images\employee\#Emp_No#.jpg">
    slideimages[#Counter#]='<a href="/EmployeeInfo/Emp_detail.cfm?emp_no=#emp_no#"><IMG SRC="/images/employee/<CFIF FileExists(outfile) IS "Yes">#Emp_No#.jpg<CFELSE>no_photo.jpg</CFIF>" WIDTH=75 HEIGHT=102 BORDER=0 ALT="Photo of #Nick_name# #Last_name#"><br>#Nick_Name# #Last_name#</A><BR>'
    <CFSET Counter=Counter+1>
    </CFOUTPUT>
    </CFIF>
    //slideimages[2]='<img src="http://calweb.calibresys.com/images/employee/737.jpg" WIDTH=72 HEIGHT=100 BORDER=0 >'
    //slideimages[3]='<img src="http://calweb.calibresys.com/images/employee/737.jpg" WIDTH=72 HEIGHT=100 BORDER=0 >'
    //slideimages[4]='<img src="http://calweb.calibresys.com/images/employee/737.jpg" WIDTH=72 HEIGHT=100 BORDER=0 >'
    //extend this list

    ///////Do not edit pass this line///////////////////////

    //var ie=document.all
    //var dom=document.getElementById

    if (slideimages.length>1)
    i=2
    else
    i=0

    function move1(whichlayer){
    tlayer=eval(whichlayer)
    if (tlayer.top>0&&tlayer.top<=5){
    tlayer.top=0
    setTimeout("move1(tlayer)",pausebetweenimages)
    setTimeout("move2(document.main.document.second)",pausebetweenimages)
    return
    }
    if (tlayer.top>=tlayer.document.height*-1){
    tlayer.top-=5
    setTimeout("move1(tlayer)",100)
    }
    else{
    tlayer.top=parseInt(scrollerheight)
    tlayer.document.write(slideimages[i])
    tlayer.document.close()
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }

    function move2(whichlayer){
    tlayer2=eval(whichlayer)
    if (tlayer2.top>0&&tlayer2.top<=5){
    tlayer2.top=0
    setTimeout("move2(tlayer2)",pausebetweenimages)
    setTimeout("move1(document.main.document.first)",pausebetweenimages)
    return
    }
    if (tlayer2.top>=tlayer2.document.height*-1){
    tlayer2.top-=5
    setTimeout("move2(tlayer2)",100)
    }
    else{
    tlayer2.top=parseInt(scrollerheight)
    tlayer2.document.write(slideimages[i])
    tlayer2.document.close()
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }

    function move3(whichdiv){
    tdiv=eval(whichdiv)
    if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
    tdiv.style.top=0+"px"
    setTimeout("move3(tdiv)",pausebetweenimages)
    setTimeout("move4(second2_obj)",pausebetweenimages)
    return
    }
    if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
    tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
    setTimeout("move3(tdiv)",100)
    }
    else{
    tdiv.style.top=scrollerheight
    tdiv.innerHTML=slideimages[i]
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }

    function move4(whichdiv){
    tdiv2=eval(whichdiv)
    if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
    tdiv2.style.top=0+"px"
    setTimeout("move4(tdiv2)",pausebetweenimages)
    setTimeout("move3(first2_obj)",pausebetweenimages)
    return
    }
    if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
    tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
    setTimeout("move4(second2_obj)",100)
    }
    else{
    tdiv2.style.top=scrollerheight
    tdiv2.innerHTML=slideimages[i]
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }

    function startscroll(){
    //if (ie||dom){
    if (document.all){
    first2_obj=ie? first2 : document.getElementById("first2")
    second2_obj=ie? second2 : document.getElementById("second2")
    move3(first2_obj)
    second2_obj.style.top=scrollerheight
    second2_obj.style.visibility='visible'
    }
    else if (document.layers){
    document.main.visibility='show'
    move1(document.main.document.first)
    document.main.document.second.top=parseInt(scrollerheight)+5
    document.main.document.second.visibility='show'
    }
    }
    //This is now loaded in the body tag on main.cfm onLoad="startscroll();"
    //window.onload=startscroll

    window.onload=startscroll

    </script>


    <ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; visibility=hide>
    <layer id="first" left=0 top=1 width=&{scrollerwidth};>
    <script language="JavaScript1.2">
    if (document.layers)
    document.write(slideimages[0])
    </script>
    </layer>
    <layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
    <script language="JavaScript1.2">
    if (document.layers)
    document.write(slideimages[dyndetermine=(slideimages.length==1)? 0 : 1])
    </script>
    </layer>
    </ilayer>

    <script language="JavaScript1.2">
    //if (ie||dom){
    if (document.all){
    document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;">')
    document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
    document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
    document.write(slideimages[0])
    document.writeln('</div>')
    document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
    document.write(slideimages[dyndetermine=(slideimages.length==1)? 0 : 1])
    document.writeln('</div>')
    document.writeln('</div>')
    document.writeln('</div>')
    }
    </script>

    <CFELSEIF Start_list.RecordCount EQ 1>
    <!--- This is a dummy startscroll function because it is called everytime main.cfm loads --->
    <script language="JavaScript">
    <!--
    function startscroll(){ return true}
    //-->
    </script>
    <CFOUTPUT QUERY="Start_list">
    <a href="/EmployeeInfo/Emp_detail.cfm?emp_no=#emp_no#"><IMG SRC="/images/employee/#Emp_No#.jpg" WIDTH=75 HEIGHT=102 BORDER=0 ALT="Photo of #Nick_name# #Last_name#"><br>#Nick_Name# #Last_name#</A><BR>
    </CFOUTPUT>
    <CFELSE>
    <!--- This is a dummy startscroll function because it is called everytime main.cfm loads --->
    <script language="JavaScript">
    <!--
    function startscroll(){ return true}
    //-->
    </script>
    <BR>
    No new CALIBRE employees in last 30 days.
    <BR>
    </CFIF>
    <BR>
    </FONT>
    </TD>
    </TR>
    </TABLE>

    END OF SCRIPT....

    THANKS TO ALL!!!!!!
    Lynn
    Last edited by lynnkeen; 10-12-2005 at 12:56 PM. Reason: Change in formatting of the request.

  2. #2
    Join Date
    Oct 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hello?

    I'm dying out here...anyone have any help ideas on how I can get this repaired?

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
  •