Results 1 to 2 of 2

Thread: Javacript Code Help

  1. #1
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javacript Code Help

    I need help with one website that I am webmaster for. I have a few photo pages and the top menu is in Javascript. Also, I have a photo slide show in Javascript. On the home page, the menu works fine but on the photo pages there is an error due to two functions (I think).

    What do I need to do to have the menu work and the slide show?
    The code is too long to include below but the website url is:
    http://www.assumption.ny.goarch.org/2011MemorialDay.htm
    Best viewed in Internet Explorer. Thanks.

    Chris

  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

    Find this section (highlighted) in the slideshow script:

    Code:
     . . . fernce=500; // The speed that the autplay speed is changed by
    autostart=1;
    preloadslides=1;
    </SCRIPT><!-- end of configurable script --><!-- plugin scripts --><SCRIPT>
    // Random order script
    function makeRandom() {
    tempimage = new Array();
    for(p=0;p<theimage.length;p++){
    for(p1=0;p1>-1;p1) {tempNum = Math.floor(Math.random()*theimage.length)
    if(!tempimage[tempNum]){tempimage[tempNum]=theimage[p];break}}}
    for(p=0;p<theimage.length;p++)theimage[p]=tempimage[p]}
    if(randomorder==1)makeRandom()
    
    // Preloader
    function preloadSlide() {for(k=0;k<til;k++) {theimage[k][1]=new Image().src=theimage[k][1];}}
    
    // Add extra functions between the {} if you need other functions that require the onload
    window.onload=function(){
    if(window.preloadslides)preloadSlide();if(window.autostart)slidePlay();}
    
    // NS4 resize handler
    window.onresize=function(){
    if(document.layers)this.locat . . .
    Change it as shown:

    Code:
     . . . fernce=500; // The speed that the autplay speed is changed by
    autostart=1;
    preloadslides=1;
    </SCRIPT><!-- end of configurable script --><!-- plugin scripts --><SCRIPT>
    // Random order script
    function makeRandom() {
    tempimage = new Array();
    for(p=0;p<theimage.length;p++){
    for(p1=0;p1>-1;p1) {tempNum = Math.floor(Math.random()*theimage.length)
    if(!tempimage[tempNum]){tempimage[tempNum]=theimage[p];break}}}
    for(p=0;p<theimage.length;p++)theimage[p]=tempimage[p]}
    if(randomorder==1)makeRandom()
    
    // Preloader
    function preloadSlide() {for(k=0;k<til;k++) {theimage[k][1]=new Image().src=theimage[k][1];}}
    
    // Add extra functions between the {} if you need other functions that require the onload
    window.onload=function(){
    if(window.preloadslides)preloadSlide();if(window.autostart)slidePlay();
    loadFunction();
    }
    
    // NS4 resize handler
    window.onresize=function(){
    if(document.layers)this.location=this.locat . . .
    - 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
  •