Results 1 to 3 of 3

Thread: Help with script alteration

  1. #1
    Join Date
    Aug 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with script alteration

    1) Script Title: Presentational Slide show

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ationslide.htm

    3) Describe problem: I am currently redesigning my website using Frontpage 2003. I am using a Template to enable me to update my pages quickly. On the bottom right hand side of my template page I have used the Presentational Slide Show to display a number of Artillery Badges see: http://www.australianartilleryassoci...tion/index.htm , which works great, however I have a number of pages which are contained within a folder and for whatever reason the script is not referencing properly, see: http://www.australianartilleryassoci...d_regiment.htm .

    Is anyone able to tell me where within the script of the Presentational Slide Show on the pages contained within a folder I need to alter and what I need to insert (which I assume will be the folder name).

    Your assistance would be greatly appreciated.

    Thanks from Down Under is Aus !

    Hampo

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Hi, I don't understand your folder structure, but one thing you can try is using absolute paths like this
    dropimages[0]="http://www.australianartilleryassociation.com/australian_artillery_association/home_page_slideshow/arty_badge_001.gif"

  3. #3
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    that is a very old script

    try

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <style type="text/css">
    /*<![CDATA[*/
    
    #tst {
     position:relative;width:250px;height:200px;
    }
    
    
    #tst2 {
     position:relative;width:250px;height:200px;
    }
    
    #tst2 IMG {
     position:relative;width:150px;height:150px;
    }
    
    /*]]>*/
    </style>
    <script type="text/javascript">
    
    function zxcImageSlider(o){
     var p=document.getElementById(o.ID),oop=this;
     p.style.overflow='hidden';
     this.cnt=p.getElementsByTagName('IMG')[0]?1:0;
     var path=o.ImagePath||'';
     this.imgary=[];
     for (var z0=0;z0<o.ImageArray.length;z0++){
      this.imgary[z0]=new Image();
      this.imgary[z0].src=path+o.ImageArray[z0];
     }
     this.min=-p.offsetWidth;
     this.frames=[];
     var f1=document.createElement('DIV');
     f1.style.position='absolute';
     f1.style.zIndex='1';
     f1.style.backgroundColor=o.BackgroundColor||'#FFFFFF';
     f1.style.width=p.offsetWidth+'px';
     f1.style.height=p.offsetHeight+'px';
     f1.style.left=this.min+'px';
     f1.style.top='0px';
     p.appendChild(f1);
     var img1=document.createElement('IMG');
     img1.style.position='absolute';
     img1.style.left='0px';
     img1.style.top='0px';
     img1.src=this.imgary[0].src;
     f1.appendChild(img1);
     var f2=f1.cloneNode(true);
     f2.getElementsByTagName('IMG')[0].src=this.imgary[1].src;
     p.appendChild(f2);
     this.frames=[f1,f2];
     this.ms=o.Speed||20;
     this.hold=o.Hold||this.ms*10;
     this.Increment=o.Increment||1;
     setTimeout(function(){ oop.swap(); },this.hold);
    }
    
    zxcImageSlider.prototype={
    
     swap:function(){
      if (this.imgary[this.cnt].width>40){
       this.frames.reverse();
       this.frames[0].style.zIndex='1';
       this.frames[1].style.zIndex='2';
       var img=this.frames[1].getElementsByTagName('IMG')[0];
       img.style.left=(this.frames[1].offsetWidth-img.width)/2+'px';
       img.style.top=(this.frames[1].offsetHeight-img.height)/2+'px';
       img.src=this.imgary[this.cnt].src;
       this.cnt=++this.cnt%this.imgary.length;
       this.rotate(this.min);
      }
      else {
       this.cnt=++this.cnt%this.imgary.length;
       var oop=this;
       setTimeout(function(){ oop.swap(); },10);
      }
     },
    
     rotate:function(lft){
      var oop=this;
      this.frames[1].style.left=lft+'px';
      lft+=this.Increment;
      if (lft<1){
       setTimeout(function(){ oop.rotate(lft); },this.ms);
      }
      else {
       this.frames[1].style.left='0px';
       setTimeout(function(){ oop.swap(); },this.hold);
      }
     }
    }
    
    </script>
    
    </head>
    
    <body>
    <div id="tst" onmouseover="S.Increment=0;"  onmouseout="S.Increment=1;">
    <img src="http://www.australianartilleryassociation.com/australian_artillery_association/home_page_slideshow/arty_badge_001.jpg" />
    </div>
    
    <div id="tst2" onmouseover="S1.Increment=0;"  onmouseout="S1.Increment=1;">
    </div>
    
    <script type="text/javascript">
    /*<![CDATA[*/
    
    
    var S=new zxcImageSlider({
     ID:'tst',
     BackgroundColor:'#ffffff',
     ImagePath:'http://www.australianartilleryassociation.com/australian_artillery_association/home_page_slideshow/',
     ImageArray:[
    'arty_badge_001.jpg',
    'arty_badge_002.gif',
    'arty_badge_003.jpg',
    'arty_badge_004.gif',
    'arty_badge_005.jpg',
    'arty_badge_006.gif',
    'arty_badge_007.png',
    'arty_badge_008.jpg',
    'arty_badge_009.gif',
    'arty_badge_010.jpg',
    'arty_badge_011.jpg'
     ],
     Increment:1,
     Speed:10, // fast = 10, slow = 100
     Hold:2000
    });
    
    var S1=new zxcImageSlider({
     ID:'tst2',
     ImagePath:'http://www.australianartilleryassociation.com/australian_artillery_association/home_page_slideshow/',
     ImageArray:[
    'arty_badge_001.jpg',
    'arty_badge_002.gif',
    'arty_badge_003.jpg',
    'arty_badge_004.gif',
    'arty_badge_005.jpg',
     ]
    });
    /*]]>*/
    </script>
    </body>
    
    </html>
    Last edited by vwphillips; 08-26-2010 at 04:05 PM. Reason: Added mouseover + check for good image
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

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
  •