Results 1 to 8 of 8

Thread: Memory Scroller - Change Font Color?

  1. #1
    Join Date
    Jun 2005
    Location
    Los Angeles
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Memory Scroller - Change Font Color?

    1) Script Title: Memory Scroller

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

    3) Describe problem: How can I change the font color on the memory scroller?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Here, I just editted the script. Change the highlighted.
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Memory Scroller script-  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 memorywidth="300px" //scroller width
    var memoryheight="20px" //scroller height
    var memorybgcolor="#DEFDD9" //scroller background
    var memorycolor = "blue";
    var memorypadding="2px" //padding applied to the scroller. 0 for non.
    var borderCSS="border: 1px solid black;" //Border CSS, applied to scroller to give border.
    
    var memoryspeed=2 //Scroller speed (larger is faster 1-10)
    var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?
    
    var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
    var persistmsgbehavior="onload" //set to "onload" or "onclick".
    
    //Specify the scroller's content (don't delete <nobr> tag)
    //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
    
    var memorycontent='<nobr><span style="font: bold 13px Verdana">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> If you find this script useful, please consider <a href="http://www.dynamicdrive.com/link.htm">linking to</a> or <a href="http://www.dynamicdrive.com/recommendit/">recommending</a> Dynamic Drive.</span></nobr>'
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;color:"+memorycolor+";background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
    var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"
    
    var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
    memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) //slow speed down by 1 for NS
    var copyspeed=memoryspeed
    var pausespeed=(pauseit==0)? copyspeed: 0
    var iedom=document.all||document.getElementById
    if (iedom)
    document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px">'+memorycontent+'</span>')
    var actualwidth=''
    var memoryscroller
    
    if (window.addEventListener)
    window.addEventListener("load", populatescroller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", populatescroller)
    else if (document.all || document.getElementById)
    window.onload=populatescroller
    
    function populatescroller(){
    memoryscroller=document.getElementById? document.getElementById("memoryscroller") : document.all.memoryscroller
    memoryscroller.style.left=parseInt(memorywidth)+8+"px"
    if (persistlastviewedmsg && get_cookie("lastscrollerpos")!="")
    revivelastmsg()
    memoryscroller.innerHTML=memorycontent
    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
    lefttime=setInterval("scrollmarquee()",20)
    }
    
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = ""
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset)
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }
    
    function savelastmsg(){
    document.cookie="lastscrollerpos="+memoryscroller.style.left
    }
    
    function revivelastmsg(){
    lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
    memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
    }
    
    if (persistlastviewedmsg && persistmsgbehavior=="onload")
    window.onunload=savelastmsg
    
    function scrollmarquee(){
    if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
    memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
    else
    memoryscroller.style.left=parseInt(memorywidth)+8+"px"
    }
    
    if (iedom){
    with (document){
    document.write('<table border="0" cellspacing="0" cellpadding="0" style="'+combinedcssTable+'"><td>')
    write('<div style="position:relative;overflow:hidden;'+combinedcss+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=memoryspeed">')
    write('<div id="memoryscroller" style="position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
    write('</div>')
    document.write('</td></table>')
    }
    }
    </script>
    Hope it helps!
    Jeremy | jfein.net

  3. #3
    Join Date
    Jun 2005
    Location
    Los Angeles
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's not working. Am I doing something wrong?

    <script type="text/javascript">

    /***********************************************
    * Memory Scroller script- 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 memorywidth="500px" //scroller width
    var memoryheight="22px" //scroller height
    var memorybgcolor="#000000" //scroller background
    var memorycolor="yellow"; //Font color
    var memorypadding="2px" //padding applied to the scroller. 0 for non.
    var borderCSS="border: 0px solid black;" //Border CSS, applied to scroller to give border.

    var memoryspeed=3 //Scroller speed (larger is faster 1-10)
    var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?

    var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
    var persistmsgbehavior="onload" //set to "onload" or "onclick".

    //Specify the scroller's content (don't delete <nobr> tag)
    //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

    var memorycontent='<nobr><span style="font: bold 17px Verdana">We will be Closed on Saturdays till August 2nd. Thank you.</span></nobr>'

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I don't know it should be working...
    Jeremy | jfein.net

  5. #5
    Join Date
    Jun 2005
    Location
    Los Angeles
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok, I just realized you didn't have me change this line:

    ////NO NEED TO EDIT BELOW THIS LINE////////////
    var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;color:"+memorycolor+";background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"

    (How do you highlight on this thing?)

    I changed it but it STILL is not working!!!

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Thats not supposed do be changed, but try this:
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Memory Scroller script-  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 memorywidth="300px" //scroller width
    var memoryheight="20px" //scroller height
    var memorybgcolor="#DEFDD9" //scroller background
    var memorycolor = "blue";
    var memorypadding="2px" //padding applied to the scroller. 0 for non.
    var borderCSS="border: 1px solid black;" //Border CSS, applied to scroller to give border.
    
    var memoryspeed=2 //Scroller speed (larger is faster 1-10)
    var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?
    
    var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
    var persistmsgbehavior="onload" //set to "onload" or "onclick".
    
    //Specify the scroller's content (don't delete <nobr> tag)
    //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
    
    var memorycontent='<nobr><span style="font: bold 13px Verdana">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> If you find this script useful, please consider <a href="http://www.dynamicdrive.com/link.htm">linking to</a> or <a href="http://www.dynamicdrive.com/recommendit/">recommending</a> Dynamic Drive.</span></nobr>'
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
    var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"
    
    var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
    memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) //slow speed down by 1 for NS
    var copyspeed=memoryspeed
    var pausespeed=(pauseit==0)? copyspeed: 0
    var iedom=document.all||document.getElementById
    if (iedom)
    document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px;color:'+memorycolor+';">'+memorycontent+'</span>')
    var actualwidth=''
    var memoryscroller
    
    if (window.addEventListener)
    window.addEventListener("load", populatescroller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", populatescroller)
    else if (document.all || document.getElementById)
    window.onload=populatescroller
    
    function populatescroller(){
    memoryscroller=document.getElementById? document.getElementById("memoryscroller") : document.all.memoryscroller
    memoryscroller.style.left=parseInt(memorywidth)+8+"px"
    if (persistlastviewedmsg && get_cookie("lastscrollerpos")!="")
    revivelastmsg()
    memoryscroller.innerHTML=memorycontent
    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
    lefttime=setInterval("scrollmarquee()",20)
    }
    
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = ""
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset)
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }
    
    function savelastmsg(){
    document.cookie="lastscrollerpos="+memoryscroller.style.left
    }
    
    function revivelastmsg(){
    lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
    memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
    }
    
    if (persistlastviewedmsg && persistmsgbehavior=="onload")
    window.onunload=savelastmsg
    
    function scrollmarquee(){
    if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
    memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
    else
    memoryscroller.style.left=parseInt(memorywidth)+8+"px"
    }
    
    if (iedom){
    with (document){
    document.write('<table border="0" cellspacing="0" cellpadding="0" style="'+combinedcssTable+'"><td>')
    write('<div style="position:relative;overflow:hidden;'+combinedcss+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=memoryspeed">')
    write('<div id="memoryscroller" style="position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
    write('</div>')
    document.write('</td></table>')
    }
    }
    </script>
    and if that doesn't work, try this:
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Memory Scroller script-  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 memorywidth="300px" //scroller width
    var memoryheight="20px" //scroller height
    var memorybgcolor="#DEFDD9" //scroller background
    var memorycolor = "blue";
    var memorypadding="2px" //padding applied to the scroller. 0 for non.
    var borderCSS="border: 1px solid black;" //Border CSS, applied to scroller to give border.
    
    var memoryspeed=2 //Scroller speed (larger is faster 1-10)
    var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?
    
    var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
    var persistmsgbehavior="onload" //set to "onload" or "onclick".
    
    //Specify the scroller's content (don't delete <nobr> tag)
    //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
    
    var memorycontent='<nobr><span style="font: bold 13px Verdana">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> If you find this script useful, please consider <a href="http://www.dynamicdrive.com/link.htm">linking to</a> or <a href="http://www.dynamicdrive.com/recommendit/">recommending</a> Dynamic Drive.</span></nobr>'
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
    var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"
    
    var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
    memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) //slow speed down by 1 for NS
    var copyspeed=memoryspeed
    var pausespeed=(pauseit==0)? copyspeed: 0
    var iedom=document.all||document.getElementById
    if (iedom)
    document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px;">'+memorycontent+'</span>')
    var actualwidth=''
    var memoryscroller
    
    if (window.addEventListener)
    window.addEventListener("load", populatescroller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", populatescroller)
    else if (document.all || document.getElementById)
    window.onload=populatescroller
    
    function populatescroller(){
    memoryscroller=document.getElementById? document.getElementById("memoryscroller") : document.all.memoryscroller
    memoryscroller.style.left=parseInt(memorywidth)+8+"px"
    if (persistlastviewedmsg && get_cookie("lastscrollerpos")!="")
    revivelastmsg()
    memoryscroller.innerHTML=memorycontent
    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
    lefttime=setInterval("scrollmarquee()",20)
    }
    
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = ""
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset)
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }
    
    function savelastmsg(){
    document.cookie="lastscrollerpos="+memoryscroller.style.left
    }
    
    function revivelastmsg(){
    lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
    memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
    }
    
    if (persistlastviewedmsg && persistmsgbehavior=="onload")
    window.onunload=savelastmsg
    
    function scrollmarquee(){
    if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
    memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
    else
    memoryscroller.style.left=parseInt(memorywidth)+8+"px"
    }
    
    if (iedom){
    with (document){
    document.write('<table border="0" cellspacing="0" cellpadding="0" style="'+combinedcssTable+'"><td>')
    write('<div style="color:'+memorycolor+';position:relative;overflow:hidden;'+combinedcss+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=memoryspeed">')
    write('<div id="memoryscroller" style="position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
    write('</div>')
    document.write('</td></table>')
    }
    }
    </script>
    Jeremy | jfein.net

  7. #7
    Join Date
    Jun 2005
    Location
    Los Angeles
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The second one worked!! Thank you so much! Are you the author of that code?

  8. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    No, I'm not. Your welcome, though.
    Jeremy | jfein.net

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
  •