Results 1 to 5 of 5

Thread: Extreme newbie having trouble with links on Fading Scroller

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

    Default Extreme newbie having trouble with links on Fading Scroller

    1) Script Title:
    Fading Scroller

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

    3) Describe problem:
    I have two active scrolls (?) each of which links to another page.... the first one (for Portland) works GREAT! The second one (for Chicago -- this will make sense when you see it), not so much... I've tried editing the link address about 4800 times and I can't seem to figure it out. Any help?

    Here's the page where I'm having the trouble:

    www.jojostein.com

    Any help will be macho appreciated.

    Cheers,
    johanna


    [CODE]
    <script type="text/javascript">

    /***********************************************
    * Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    var delay = 2000; //set delay between message change (in miliseconds)
    var maxsteps=50; // number of steps to take to change from start color to endcolor
    var stepdelay=40; // time in miliseconds of a single step
    //**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
    var startcolor= new Array(255,255,255); // start color (red, green, blue)
    var endcolor=new Array(0,0,0); // end color (red, green, blue)

    var fcontent=new Array();
    begintag='<div style="font: normal 12px Arial; padding: 5px;">'; //set opening tag, such as font declarations
    fcontent[0]="<b>Upcoming Appearances: 9-22-10 Portland <i>'Back Porch PDX' storytelling show </i><a href='http://backfencepdx.com/'> Click for info</a>";
    fcontent[1]="<b>Upcoming Appearances: 9-28-10 Chicago <i> 'FunnyHaHa' reading series/comedy show </i><a href='http://backfencepdx.com/'> Click for info</a>";
    closetag='</div>';

    var fwidth='600px'; //set scroller width
    var fheight='28px'; //set scroller height

    var fadelinks=1; //should links inside scroller content also fade like text? 0 for no, 1 for yes.

    ///No need to edit below this line/////////////////


    var ie4=document.all&&!document.getElementById;
    var DOM2=document.getElementById;
    var faderdelay=0;
    var index=0;


    /*Rafael Raposo edited function*/
    //function to change content
    function changecontent(){
    if (index>=fcontent.length)
    index=0
    if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
    linkcolorchange(1);
    colorfade(1, 15);
    }
    else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
    index++
    }

    // colorfade() partially by Marcio Galli for Netscape Communications. ////////////
    // Modified by Dynamicdrive.com

    function linkcolorchange(step){
    var obj=document.getElementById("fscroller").getElementsByTagName("A");
    if (obj.length>0){
    for (i=0;i<obj.length;i++)
    obj[i].style.color=getstepcolor(step);
    }
    }

    /*Rafael Raposo edited function*/
    var fadecounter;
    function colorfade(step) {
    if(step<=maxsteps) {
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
    linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
    }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);

    }
    }

    /*Rafael Raposo's new function*/
    function getstepcolor(step) {
    var diff
    var newcolor=new Array(3);
    for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
    newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
    newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
    }
    return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
    }

    if (ie4||DOM2)
    document.write('<div id="fscroller" style="border:1px solid black;width:'+fwidth+';height:'+fheight+'"></div>');

    if (window.addEventListener)
    window.addEventListener("load", changecontent, false)
    else if (window.attachEvent)
    window.attachEvent("onload", changecontent)
    else if (document.getElementById)
    window.onload=changecontent

    </script>
    [CODE]

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

    Default

    This part will be where you need to edit the url highlighted in red
    Code:
    var fcontent=new Array();
    begintag='<div style="font: normal 12px Arial; padding: 5px;">'; //set opening tag, such as font declarations
    fcontent[0]="<b>Upcoming Appearances: 9-22-10 Portland <i>'Back Porch PDX' storytelling show </i><a href='http://backfencepdx.com/'> Click for info</a>";
    fcontent[1]="<b>Upcoming Appearances: 9-28-10 Chicago <i> 'FunnyHaHa' reading series/comedy show </i><a href='http://backfencepdx.com/'> Click for info</a>";
    closetag='</div>';
    (Scroll to the right to see it)

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

    Default Sorry - I messed up...

    In my posting of the code I mistakenly posted one of the mannnny versions in which I tried pasting random addresses to make sure I could get something to work...

    So here is the code that I want to work, but doesn't (I'm trying to link to the following web address: http://www.zulkey.com/funnyhaha.html)
    but all I get is a "Not Found" message that pops up on my page and stays there...

    [code]
    <script type="text/javascript">

    /***********************************************
    * Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    var delay = 2000; //set delay between message change (in miliseconds)
    var maxsteps=50; // number of steps to take to change from start color to endcolor
    var stepdelay=40; // time in miliseconds of a single step
    //**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
    var startcolor= new Array(255,255,255); // start color (red, green, blue)
    var endcolor=new Array(0,0,0); // end color (red, green, blue)

    var fcontent=new Array();
    begintag='<div style="font: normal 12px Arial; padding: 5px;">'; //set opening tag, such as font declarations
    fcontent[0]="<b>Upcoming Appearances: 9-22-10 Portland <i>'Back Porch PDX' storytelling show </i><a href='http://backfencepdx.com/'> Click for info</a>";
    fcontent[1]="<b>Upcoming Appearances: 9-28-10 Chicago <i> 'FunnyHaHa' reading series/comedy show </i><a href='http://www.zulkey.com/funnyhaha.html/'> Click for info</a>";
    closetag='</div>';

    var fwidth='600px'; //set scroller width
    var fheight='28px'; //set scroller height

    var fadelinks=1; //should links inside scroller content also fade like text? 0 for no, 1 for yes.

    ///No need to edit below this line/////////////////


    var ie4=document.all&&!document.getElementById;
    var DOM2=document.getElementById;
    var faderdelay=0;
    var index=0;


    /*Rafael Raposo edited function*/
    //function to change content
    function changecontent(){
    if (index>=fcontent.length)
    index=0
    if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
    linkcolorchange(1);
    colorfade(1, 15);
    }
    else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
    index++
    }

    // colorfade() partially by Marcio Galli for Netscape Communications. ////////////
    // Modified by Dynamicdrive.com

    function linkcolorchange(step){
    var obj=document.getElementById("fscroller").getElementsByTagName("A");
    if (obj.length>0){
    for (i=0;i<obj.length;i++)
    obj[i].style.color=getstepcolor(step);
    }
    }

    /*Rafael Raposo edited function*/
    var fadecounter;
    function colorfade(step) {
    if(step<=maxsteps) {
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
    linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
    }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);

    }
    }

    /*Rafael Raposo's new function*/
    function getstepcolor(step) {
    var diff
    var newcolor=new Array(3);
    for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
    newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
    newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
    }
    return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
    }

    if (ie4||DOM2)
    document.write('<div id="fscroller" style="border:1px solid black;width:'+fwidth+';height:'+fheight+'"></div>');

    if (window.addEventListener)
    window.addEventListener("load", changecontent, false)
    else if (window.attachEvent)
    window.attachEvent("onload", changecontent)
    else if (document.getElementById)
    window.onload=changecontent

    </script>

    [code]

    Thanks for any help you can offer!

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

    Default

    did you try to take away the slash
    Code:
    <a href='http://www.zulkey.com/funnyhaha.html/'> Click for info</a>
    like this
    Code:
    <a href='http://www.zulkey.com/funnyhaha.html'> Click for info</a>

  5. #5
    Join Date
    Sep 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried that... it still doesn't work -- you'll see if you give it a click...

    www.jojostein.com

    (click on the second scrolling item, "Chicago 'FunnyHaHa' reading series/comedy show")

    Any other thoughts???

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
  •