Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Question on "modifying" jscheuer1's Vertical Slideshow

  1. #1
    Join Date
    May 2012
    Location
    Derby, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Question on "modifying" jscheuer1's Vertical Slideshow

    Hi - relative newbie here when it comes to scripting/coding ;-)

    I've had need for a vertically-scrolling slideshow on a page in a new website I'm creating. Thanks to Google and the Dynamic Drive Forums, I found *almost* exactly what I needed with jscheuer1's excellent script at

    http://home.comcast.net/~jscheuer1/s...ee_v_slide.htm

    It scrolls, you can pause it with a mouseover *and* each image can be a clickable link - brilliant !! :-)

    However.... ;-)

    Initially I have dozens of images to put into the array and importantly, all in a particular order - ok, a bit tedious typing it all, but no real problem. BUT.... I will need to add new images to the array on a fairly regular basis (and occasionally delete some) - and I have to keep them *in order*.

    I thought I'd figured a simple workaround - but it doesn't work :-(

    With the original array being specified like this :-

    Code:
    var photos=new Array();
    //Specify images, optional link, optional target:
    photos[0]=['files/photo1.jpg', 'http://www.google.com', '_blank']
    photos[1]=['files/photo2.jpg', 'http://www.dynamicdrive.com']
    photos[2]=['files/photo3.jpg']
    photos[3]=['files/photo4.jpg']
    I *thought* that *if* I could simply change it to :-

    Code:
    var photos=new Array();
    //Specify images, optional link, optional target:
    photos[00]=['files/photo1.jpg', 'http://www.google.com', '_blank']
    photos[10]=['files/photo2.jpg', 'http://www.dynamicdrive.com']
    photos[20]=['files/photo3.jpg']
    photos[30]=['files/photo4.jpg']
    ... then when I come to add/insert any new images to the array, then to keep them appearing in the order I want, I could add them *between* the existing numbers (like in the good old days of line numbers programming in Basic, etc. !) For example :-

    Code:
    var photos=new Array();
    //Specify images, optional link, optional target:
    photos[00]=['files/photo1.jpg', 'http://www.google.com', '_blank']
    photos[10]=['files/photo2.jpg', 'http://www.dynamicdrive.com']
    photos[12]=['files/photo5.jpg']
    photos[20]=['files/photo3.jpg']
    photos[22]=['files/photo7.jpg']
    photos[25]=['files/photo6.jpg']
    photos[30]=['files/photo4.jpg']
    But... as it stands, it doesn't work - if the array is not numbered "photos[0], photos[1], photos[2], photos[3], etc., etc, then it simply doesn't display *any* images in the scroller.

    So - short story long - is there any way I can modify the script to be able to have none-consecutive "photos[??]" numbering in the array...??

    Apologies if I'm being stupid... I've searched for an answer to this already but have drawn a blank - and my scripting experience is obviously not up to being able to figure out the "guts" of the original Vertical slideshow script !

    Many thanks for your time !

    Gary

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

    Default

    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>
    </head>
    
    <body>
    <script type="text/javascript">
    /*<![CDATA[*/
    var photos=new Array();
    //Specify images, optional link, optional target:
    photos[0]=[0,'files/photo1.jpg', 'http://www.google.com', '_blank']
    photos[1]=[10,'files/photo2.jpg', 'http://www.dynamicdrive.com']
    photos[2]=[20,'files/photo3.jpg']
    photos[3]=[30,'files/photo4.jpg']
    photos[4]=[22,'files/photo3a.jpg']
    
    photos.sort(function(a,b){ return a[0]-b[0]; });
    alert(photos.join('\n'));
    
     for (var z0=0;z0<photos.length;z0++){
      photos[z0].splice(0,1);
     }
    
    alert(photos.join('\n'));
    
    /*]]>*/
    </script>
    </body>
    
    </html>
    or

    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>
    </head>
    
    <body>
    <script type="text/javascript">
    /*<![CDATA[*/
    var photos=[
    //Specify images, optional link, optional target:
    [0,'files/photo1.jpg', 'http://www.google.com', '_blank'],
    [10,'files/photo2.jpg', 'http://www.dynamicdrive.com'],
    [20,'files/photo3.jpg'],
    [30,'files/photo4.jpg'],
    [22,'files/photo3a.jpg']
    ];
    
    photos.sort(function(a,b){ return a[0]-b[0]; });
    alert(photos.join('\n'));
    
     for (var z0=0;z0<photos.length;z0++){
      photos[z0].splice(0,1);
     }
    
    alert(photos.join('\n'));
    
    /*]]>*/
    </script>
    </body>
    
    </html>
    or best

    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>
    </head>
    
    <body>
    <script type="text/javascript">
    /*<![CDATA[*/
    var photos=[
    //Specify images, optional link, optional target:
    ['files/photo1.jpg', 'http://www.google.com', '_blank'],
    ['files/photo2.jpg', 'http://www.dynamicdrive.com'],
    ['files/photo3.jpg'],
    ['files/photo3a.jpg'],
    ['files/photo4.jpg']
    ];
    
    
    alert(photos.join('\n'));
    
    /*]]>*/
    </script>
    </body>
    
    </html>
    Last edited by vwphillips; 05-08-2012 at 03:02 PM.
    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/

  3. #3
    Join Date
    May 2012
    Location
    Derby, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Vic,

    Many thanks for your speedy response - I reckon you replied faster then it took me to type my original question !!

    Having looked at your three possibilities, I *think* I can understand what they are trying to do..... but sadly, when I use your code, it doesn't work :-(

    But... That's probably down to me just referring to the original Vertical Slideshow Script and not posting that entire script in my question the first place - I didn't want to "clog up" the thread, so I just "picked out" the section where the photos were defined in the array. If that's the case and I mislead you, apologies for that.

    But as I said, when I substitute your code (I chose example 3 as the best option) in the original Vertical Slideshow Script, it doesn't work.... so either I'm being dumb (quite possible), or there's more to it....

    So here's the original Vertical Slideshow Script in its entirety :-

    Code:
    <script type="text/javascript">
    
    /*
    
    Vertical Pausing Slideshow - freely adapted from:
    
    Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
    
    For full source code, 100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com
    
    Modified by jscheuer1 for continuous content slideshow. Credit MUST stay intact for use
    
    visit http://www.dynamicdrive.com/forums
    
    */
    
    
    
    //Specify the marquee's width (in pixels)
    
    var marqueewidth="140px"
    
    //Specify the marquee's height
    
    var marqueeheight="225px"
    
    //Specify the marquee's marquee speed (larger is faster 1-10)
    
    var marqueespeed=1
    
    //Specify initial pause before scrolling in milliseconds
    
    var initPause=1000
    
    //Specify start with Full(1)or Empty(0) Marquee
    
    var full=1
    
    //Pause marquee onMousever (0=no 1=yes)?
    
    var pauseit=1
    
    //Specify images' border
    
    imgBorder=0
    
    
    
    var photos=new Array();
    
    //Specify images, optional link, optional target:
    
    photos[0]=['files/photo1.jpg', 'http://www.google.com', '_blank']  //Image w/link and target
    
    photos[1]=['files/photo2.jpg', 'http://www.dynamicdrive.com']  //Image w/link
    
    photos[2]=['files/photo3.jpg']  //Plain Image
    
    photos[3]=['files/photo4.jpg']
    
    photos[4]=['files/photo5.jpg']
    
    photos[5]=['files/photo6.jpg']
    
    photos[6]=['files/photo7.jpg']
    
    photos[7]=['files/photo8.jpg']
    
    photos[8]=['files/photo9.jpg']
    
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    var preload=new Array()
    
    for (var i_tem = 0; i_tem < photos.length; i_tem++){
    
    preload[i_tem]=new Image()
    
    preload[i_tem].src=photos[i_tem][0]
    
    }
    
    
    
    var actualheight=marqueecontent=''
    
    var copyspeed=marqueespeed
    
    var pausespeed=(pauseit)? 0 : copyspeed
    
    var iedom=document.all||document.getElementById
    
    var cross_marquee, cross_marquee2, ns_marquee
    
    
    
    for (var i_tem = 0; i_tem < photos.length; i_tem++){
    
    if (typeof photos[i_tem][1]!=='undefined'){
    
    marqueecontent+='<a href="'+photos[i_tem][1]+'"'
    
    marqueecontent+=typeof photos[i_tem][2]!=='undefined'? ' target="'+photos[i_tem][2]+'"' : ''
    
    marqueecontent+='>'
    
    }
    
    marqueecontent+='<img src="'+photos[i_tem][0]+'" alt="Image #'+[i_tem+1]+'" border="'+imgBorder+'"><br>'
    
    marqueecontent+=typeof photos[i_tem][1]!=='undefined'? '</a>' : ''
    
    }
    
    if (iedom||document.layers){
    
    with (document){
    
    if (iedom){
    
    write('<div style="overflow:hidden;"><div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
    
    write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;"><table align="center"><tr><td height="'+marqueeheight+'" align="center" valign="middle">Loading . . .</td></tr></table>')
    
    write('</div><div id="iemarquee2" style="position:absolute;left:0px;top:0px;width:100%;">')
    
    write('</div></div></div>')
    
    }
    
    else if (document.layers){
    
    write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
    
    write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
    
    write('</ilayer>')
    
    }
    
    }
    
    }
    
    
    
    function populate(){
    
    if (document.all)
    
    for (var i_tem = 0; i_tem < preload.length; i_tem++)
    
    if (typeof preload[i_tem].complete=='boolean'&&!preload[i_tem].complete){
    
    setTimeout("populate();", 2000)
    
    return;
    
    }
    
    if (iedom){
    
    cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
    
    cross_marquee2=document.getElementById? document.getElementById("iemarquee2") : document.all.iemarquee2
    
    cross_marquee.style.top=(full==1)? '0px' : parseInt(marqueeheight)+0+"px"
    
    cross_marquee2.innerHTML=cross_marquee.innerHTML=marqueecontent
    
    actualheight=cross_marquee.offsetHeight
    
    cross_marquee2.style.top=(parseInt(cross_marquee.style.top)+actualheight+0)+"px" //indicates following #1
    
    }
    
    else if (document.layers){
    
    ns_marquee=document.ns_marquee.document.ns_marquee2
    
    ns_marquee.top=parseInt(marqueeheight)+8
    
    ns_marquee.document.write(marqueecontent)
    
    ns_marquee.document.close()
    
    actualheight=ns_marquee.document.height
    
    }
    
    setTimeout('lefttime=setInterval("scrollmarquee()",20)',initPause)
    
    }
    
    window.onload=populate
    
    
    
    function scrollmarquee(){
    
    
    
    if (iedom){
    
    if (parseInt(cross_marquee.style.top)<(actualheight*(-1)))
    
    cross_marquee.style.top=(parseInt(cross_marquee2.style.top)+actualheight)+"px"
    
    if (parseInt(cross_marquee2.style.top)<(actualheight*(-1)))
    
    cross_marquee2.style.top=(parseInt(cross_marquee.style.top)+actualheight)+"px"
    
    cross_marquee2.style.top=parseInt(cross_marquee2.style.top)-copyspeed+"px"
    
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
    
    }
    
    
    
    else if (document.layers){
    
    if (ns_marquee.top>(actualheight*(-1)+8))
    
    ns_marquee.top-=copyspeed
    
    else
    
    ns_marquee.top=parseInt(marqueeheight)+8
    
    }
    
    }
    
    </script>
    Sorry to ask you to look again. But I'd sure appreciate a bit more help !!

    Plus, I'm sorry I can't give you a link to the actual site/page - it only exists on my PC at the moment, the site is not "live" (in fact, the domain doesn't even exist yet !)

    Thanks again,

    Gary

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

    Default

    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>
    </head>
    
    <body>
    <script type="text/javascript">
    
    /*
    
    Vertical Pausing Slideshow - freely adapted from:
    
    Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
    
    For full source code, 100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com
    
    Modified by jscheuer1 for continuous content slideshow. Credit MUST stay intact for use
    
    visit http://www.dynamicdrive.com/forums
    
    */
    
    
    
    //Specify the marquee's width (in pixels)
    
    var marqueewidth="140px"
    
    //Specify the marquee's height
    
    var marqueeheight="225px"
    
    //Specify the marquee's marquee speed (larger is faster 1-10)
    
    var marqueespeed=1
    
    //Specify initial pause before scrolling in milliseconds
    
    var initPause=1000
    
    //Specify start with Full(1)or Empty(0) Marquee
    
    var full=1
    
    //Pause marquee onMousever (0=no 1=yes)?
    
    var pauseit=1
    
    //Specify images' border
    
    imgBorder=0
    
    
    
    var photos=[
    
    //Specify images, optional link, optional target:
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg', 'http://www.google.com', '_blank'],  //Image w/link and target
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt6.jpg', 'http://www.dynamicdrive.com'],  //Image w/link
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt7.jpg'],  //Plain Image
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt8.jpg'],
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt9.jpg'],
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt10.jpg'],
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt11.jpg'],
    
    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt12.jpg']
    
    ];
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    var preload=new Array()
    
    for (var i_tem = 0; i_tem < photos.length; i_tem++){
    
    preload[i_tem]=new Image()
    
    preload[i_tem].src=photos[i_tem][0]
    
    }
    
    
    
    var actualheight=marqueecontent=''
    
    var copyspeed=marqueespeed
    
    var pausespeed=(pauseit)? 0 : copyspeed
    
    var iedom=document.all||document.getElementById
    
    var cross_marquee, cross_marquee2, ns_marquee
    
    
    
    for (var i_tem = 0; i_tem < photos.length; i_tem++){
    
    if (typeof photos[i_tem][1]!=='undefined'){
    
    marqueecontent+='<a href="'+photos[i_tem][1]+'"'
    
    marqueecontent+=typeof photos[i_tem][2]!=='undefined'? ' target="'+photos[i_tem][2]+'"' : ''
    
    marqueecontent+='>'
    
    }
    
    marqueecontent+='<img src="'+photos[i_tem][0]+'" alt="Image #'+[i_tem+1]+'" border="'+imgBorder+'"><br>'
    
    marqueecontent+=typeof photos[i_tem][1]!=='undefined'? '</a>' : ''
    
    }
    
    if (iedom||document.layers){
    
    with (document){
    
    if (iedom){
    
    write('<div style="overflow:hidden;"><div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
    
    write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;"><table align="center"><tr><td height="'+marqueeheight+'" align="center" valign="middle">Loading . . .</td></tr></table>')
    
    write('</div><div id="iemarquee2" style="position:absolute;left:0px;top:0px;width:100%;">')
    
    write('</div></div></div>')
    
    }
    
    else if (document.layers){
    
    write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
    
    write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
    
    write('</ilayer>')
    
    }
    
    }
    
    }
    
    
    
    function populate(){
    
    if (document.all)
    
    for (var i_tem = 0; i_tem < preload.length; i_tem++)
    
    if (typeof preload[i_tem].complete=='boolean'&&!preload[i_tem].complete){
    
    setTimeout("populate();", 2000)
    
    return;
    
    }
    
    if (iedom){
    
    cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
    
    cross_marquee2=document.getElementById? document.getElementById("iemarquee2") : document.all.iemarquee2
    
    cross_marquee.style.top=(full==1)? '0px' : parseInt(marqueeheight)+0+"px"
    
    cross_marquee2.innerHTML=cross_marquee.innerHTML=marqueecontent
    
    actualheight=cross_marquee.offsetHeight
    
    cross_marquee2.style.top=(parseInt(cross_marquee.style.top)+actualheight+0)+"px" //indicates following #1
    
    }
    
    else if (document.layers){
    
    ns_marquee=document.ns_marquee.document.ns_marquee2
    
    ns_marquee.top=parseInt(marqueeheight)+8
    
    ns_marquee.document.write(marqueecontent)
    
    ns_marquee.document.close()
    
    actualheight=ns_marquee.document.height
    
    }
    
    setTimeout('lefttime=setInterval("scrollmarquee()",20)',initPause)
    
    }
    
    window.onload=populate
    
    
    
    function scrollmarquee(){
    
    
    
    if (iedom){
    
    if (parseInt(cross_marquee.style.top)<(actualheight*(-1)))
    
    cross_marquee.style.top=(parseInt(cross_marquee2.style.top)+actualheight)+"px"
    
    if (parseInt(cross_marquee2.style.top)<(actualheight*(-1)))
    
    cross_marquee2.style.top=(parseInt(cross_marquee.style.top)+actualheight)+"px"
    
    cross_marquee2.style.top=parseInt(cross_marquee2.style.top)-copyspeed+"px"
    
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
    
    }
    
    
    
    else if (document.layers){
    
    if (ns_marquee.top>(actualheight*(-1)+8))
    
    ns_marquee.top-=copyspeed
    
    else
    
    ns_marquee.top=parseInt(marqueeheight)+8
    
    }
    
    }
    
    </script>
    </body>
    
    </html>
    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/

  5. #5
    Join Date
    May 2012
    Location
    Derby, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Vic,

    A thousand thanks for this - and for your patience ! ;-)

    Got it all sorted now !! In fact, I was very close already, before posting my second message - but your answer and going through that code with a fine-toothed comb has taught me something about scripting and what to look out for when things don't work.....

    I'd missed a comma out on the array....! D'oh !

    Tired eyes...... ;-)

    Thanks again, very much appreciated ! (I'll be more mindful of commas next time !! lol)

    Gary

  6. #6
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help please on your version

    Hi
    I have tried the html code as below, the one I tried works on 3 photos, but the other ones I try yo add, just show as a blank picture icon, I have been struggling for days I am try to get the banner as adverts on my site, also the code I have used is .
    var photos=[

    //Specify images, optional link, optional target:

    ['http://www.cometoportugal.com/wpimages/linkphoto1.jpg','http://www.google.com', '_blank'], //Image w/link and target

    ['http://www.cometoportugal.com/wpimages/linkphoto1.jpg', 'http://www.cometoportugal.com'], //Image w/link

    ['http://www.cometoportugal.com/wpimages/wpe38022ee_05_06.jpg',
    'http://www.cometoportugal.com'], //Image w/link

    ['http://www.my site.com/wpimages/wpa7df5c90_05.jpg', 'http://www.my site.com'], //Image w/link


    ['http://www.my site.com/wpimages/fatacil-link.jpg', 'http://www.my site.com'], //Image w/link

    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt10.jpg'], //Plain image

    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt11.jpg'],

    ['http://www.vicsjavascripts.org.uk/StdImages/Egypt12.jpg']

    ];
    I have got it up and running so you can see on a test site, http://www.algarvefairs.com/page6.html. so you can see the problem it is why does it work for the first few photos but none others? not just this image but for any other I try, I have create a folder in my Cpanel on my server so I know they exist, but the just do not show up , where am I going wrong, I am trying to replicate a banner on a site called algarvedailynews
    Quote Originally Posted by Gary617 View Post
    Hi Vic,

    Many thanks for your speedy response - I reckon you replied faster then it took me to type my original question !!

    Having looked at your three possibilities, I *think* I can understand what they are trying to do..... but sadly, when I use your code, it doesn't work :-(

    But... That's probably down to me just referring to the original Vertical Slideshow Script and not posting that entire script in my question the first place - I didn't want to "clog up" the thread, so I just "picked out" the section where the photos were defined in the array. If that's the case and I mislead you, apologies for that.

    But as I said, when I substitute your code (I chose example 3 as the best option) in the original Vertical Slideshow Script, it doesn't work.... so either I'm being dumb (quite possible), or there's more to it....

    So here's the original Vertical Slideshow Script in its entirety :-

    Code:
    <script type="text/javascript">
    
    /*
    
    Vertical Pausing Slideshow - freely adapted from:
    
    Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
    
    For full source code, 100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com
    
    Modified by jscheuer1 for continuous content slideshow. Credit MUST stay intact for use
    
    visit http://www.dynamicdrive.com/forums
    
    */
    
    
    
    //Specify the marquee's width (in pixels)
    
    var marqueewidth="140px"
    
    //Specify the marquee's height
    
    var marqueeheight="225px"
    
    //Specify the marquee's marquee speed (larger is faster 1-10)
    
    var marqueespeed=1
    
    //Specify initial pause before scrolling in milliseconds
    
    var initPause=1000
    
    //Specify start with Full(1)or Empty(0) Marquee
    
    var full=1
    
    //Pause marquee onMousever (0=no 1=yes)?
    
    var pauseit=1
    
    //Specify images' border
    
    imgBorder=0
    
    
    
    var photos=new Array();
    
    //Specify images, optional link, optional target:
    
    photos[0]=['files/photo1.jpg', 'http://www.google.com', '_blank']  //Image w/link and target
    
    photos[1]=['files/photo2.jpg', 'http://www.dynamicdrive.com']  //Image w/link
    
    photos[2]=['files/photo3.jpg']  //Plain Image
    
    photos[3]=['files/photo4.jpg']
    
    photos[4]=['files/photo5.jpg']
    
    photos[5]=['files/photo6.jpg']
    
    photos[6]=['files/photo7.jpg']
    
    photos[7]=['files/photo8.jpg']
    
    photos[8]=['files/photo9.jpg']
    
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    var preload=new Array()
    
    for (var i_tem = 0; i_tem < photos.length; i_tem++){
    
    preload[i_tem]=new Image()
    
    preload[i_tem].src=photos[i_tem][0]
    
    }
    
    
    
    var actualheight=marqueecontent=''
    
    var copyspeed=marqueespeed
    
    var pausespeed=(pauseit)? 0 : copyspeed
    
    var iedom=document.all||document.getElementById
    
    var cross_marquee, cross_marquee2, ns_marquee
    
    
    
    for (var i_tem = 0; i_tem < photos.length; i_tem++){
    
    if (typeof photos[i_tem][1]!=='undefined'){
    
    marqueecontent+='<a href="'+photos[i_tem][1]+'"'
    
    marqueecontent+=typeof photos[i_tem][2]!=='undefined'? ' target="'+photos[i_tem][2]+'"' : ''
    
    marqueecontent+='>'
    
    }
    
    marqueecontent+='<img src="'+photos[i_tem][0]+'" alt="Image #'+[i_tem+1]+'" border="'+imgBorder+'"><br>'
    
    marqueecontent+=typeof photos[i_tem][1]!=='undefined'? '</a>' : ''
    
    }
    
    if (iedom||document.layers){
    
    with (document){
    
    if (iedom){
    
    write('<div style="overflow:hidden;"><div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
    
    write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;"><table align="center"><tr><td height="'+marqueeheight+'" align="center" valign="middle">Loading . . .</td></tr></table>')
    
    write('</div><div id="iemarquee2" style="position:absolute;left:0px;top:0px;width:100%;">')
    
    write('</div></div></div>')
    
    }
    
    else if (document.layers){
    
    write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
    
    write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
    
    write('</ilayer>')
    
    }
    
    }
    
    }
    
    
    
    function populate(){
    
    if (document.all)
    
    for (var i_tem = 0; i_tem < preload.length; i_tem++)
    
    if (typeof preload[i_tem].complete=='boolean'&&!preload[i_tem].complete){
    
    setTimeout("populate();", 2000)
    
    return;
    
    }
    
    if (iedom){
    
    cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
    
    cross_marquee2=document.getElementById? document.getElementById("iemarquee2") : document.all.iemarquee2
    
    cross_marquee.style.top=(full==1)? '0px' : parseInt(marqueeheight)+0+"px"
    
    cross_marquee2.innerHTML=cross_marquee.innerHTML=marqueecontent
    
    actualheight=cross_marquee.offsetHeight
    
    cross_marquee2.style.top=(parseInt(cross_marquee.style.top)+actualheight+0)+"px" //indicates following #1
    
    }
    
    else if (document.layers){
    
    ns_marquee=document.ns_marquee.document.ns_marquee2
    
    ns_marquee.top=parseInt(marqueeheight)+8
    
    ns_marquee.document.write(marqueecontent)
    
    ns_marquee.document.close()
    
    actualheight=ns_marquee.document.height
    
    }
    
    setTimeout('lefttime=setInterval("scrollmarquee()",20)',initPause)
    
    }
    
    window.onload=populate
    
    
    
    function scrollmarquee(){
    
    
    
    if (iedom){
    
    if (parseInt(cross_marquee.style.top)<(actualheight*(-1)))
    
    cross_marquee.style.top=(parseInt(cross_marquee2.style.top)+actualheight)+"px"
    
    if (parseInt(cross_marquee2.style.top)<(actualheight*(-1)))
    
    cross_marquee2.style.top=(parseInt(cross_marquee.style.top)+actualheight)+"px"
    
    cross_marquee2.style.top=parseInt(cross_marquee2.style.top)-copyspeed+"px"
    
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
    
    }
    
    
    
    else if (document.layers){
    
    if (ns_marquee.top>(actualheight*(-1)+8))
    
    ns_marquee.top-=copyspeed
    
    else
    
    ns_marquee.top=parseInt(marqueeheight)+8
    
    }
    
    }
    
    </script>
    Sorry to ask you to look again. But I'd sure appreciate a bit more help !!

    Plus, I'm sorry I can't give you a link to the actual site/page - it only exists on my PC at the moment, the site is not "live" (in fact, the domain doesn't even exist yet !)

    Thanks again,

    Gary

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

    Default

    looking at your page source you have

    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>
        </head>
        
        <body>
    just above the Vertical Pausing Slideshow
    this should be removed

    also the photo array has a comma after the last field - remove this(shown in red)

    Code:
       var photos=[
        
        //Specify images, optional link, optional target:
        
        ['http://www.cometoportugal.com/wpimages/linkphoto1.jpg','http://www.google.com', '_blank'],  //Image w/link and target
        
        ['http://www.cometoportugal.com/wpimages/linkphoto1.jpg', 'http://www.cometoportugal.com'],  //Image w/link
        
        ['http://www.cometoportugal.com/wpimages/wpe38022ee_05_06.jpg', 
         'http://www.cometoportugal.com'],  //Image w/link
        
        ['http://www.cometoportugal.com/wpimages/wpa7df5c90_05.jpg', 'http://www.cometoportugal.com'],  //Image w/link
         
        
        ['http://www.cometoportugal.com/wpimages/fatacil-link.jpg', 'http://www.cometoportugal.com'],  //Image w/link
        
        ['http://www.vicsjavascripts.org.uk/StdImages/Egypt10.jpg'], //remove this comma
        
        
        ];
    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/

  8. #8
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Quote Originally Posted by vwphillips View Post
    looking at your page source you have

    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>
        </head>
        
        <body>
    just above the Vertical Pausing Slideshow
    this should be removed

    also the photo array has a comma after the last field - remove this(shown in red)

    Code:
       var photos=[
        
        //Specify images, optional link, optional target:
        
        ['http://www.cometoportugal.com/wpimages/linkphoto1.jpg','http://www.google.com', '_blank'],  //Image w/link and target
        
        ['http://www.cometoportugal.com/wpimages/linkphoto1.jpg', 'http://www.cometoportugal.com'],  //Image w/link
        
        ['http://www.cometoportugal.com/wpimages/wpe38022ee_05_06.jpg', 
         'http://www.cometoportugal.com'],  //Image w/link
        
        ['http://www.cometoportugal.com/wpimages/wpa7df5c90_05.jpg', 'http://www.cometoportugal.com'],  //Image w/link
         
        
        ['http://www.cometoportugal.com/wpimages/fatacil-link.jpg', 'http://www.cometoportugal.com'],  //Image w/link
        
        ['http://www.vicsjavascripts.org.uk/StdImages/Egypt10.jpg'], //remove this comma
        
        
        ];
    many thanks that was a great help

  9. #9
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi many thank for your help, I have now loaded it to the website that I need it to be on but it shows the word (image#1) I do not now where I have gone wrong been trying most of the day but the problem is still there, could you take a look for me please it is on my cometoportugal web site, once again thank you for your time

  10. #10
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    also when they click on the link photo how do I get it to open in a new tab/page as currently it takes people away from my site it is
    ['http://www.mysite.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.othersite.com'], //Image w/link

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
  •