+ Reply to Thread
Results 1 to 5 of 5

Thread: Tutorial : News Scroller

  1. #1
    Active Member Fabolous05 is on a distinguished road
    Join Date
    Jun 2004
    Location
    Surrey, BC
    Posts
    151

    Tutorial : News Scroller

    Hi you can use this scroller for things like the news or for any reasons you can think of. If you edit the code you can adjust the size, background, and font of the scroller. It's only limited by your imagination

    This is a simple javascript and requires no external .js files like other tutorials of mine

    just insert this code where you want the scroller to appear,

    Code:
    <script language="JavaScript1.2">
    
    var scroller_width='150px'
    var scroller_height='115px'
    var bgcolor='#0099CC'
    var pause=3000 //milliseconds (3000=3 seconds)
    
    var scrollercontent=new Array()
    //What you want to scroll
    scrollercontent[0]='Visit the forums <a href="http://www.webmasterlingo.com">WebmasterLingo.com </a>for free web help!'
    scrollercontent[1]='Email Fabolous05 to get a new design, <a href="mailto:fabolous05@gmail.com">E-Mail</a>.'
    scrollercontent[2]='Google is the top search engine. Go give Google a try, <a href="http://www.google.com">Google</a>.'
    
    
    
    ////Hey don't proceed past here!
    var ie4=document.all
    var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
    
    if (ie4||dom)
    document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')
    else if (document.layers){
    document.write('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>')
    }
    
    var curpos=scroller_height*(1)
    var degree=10
    var curcanvas="canvas0"
    var curindex=0
    var nextindex=1
    
    function moveslide(){
    if (curpos>0){
    curpos=Math.max(curpos-degree,0)
    tempobj.style.top=curpos+"px"
    }
    else{
    clearInterval(dropslide)
    if (crossobj.filters)
    crossobj.filters.alpha.opacity=100
    else if (crossobj.style.MozOpacity)
    crossobj.style.MozOpacity=1
    nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
    tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
    tempobj.innerHTML=scrollercontent[curindex]
    nextindex=(nextindex<scrollercontent.length-1)? nextindex+1 : 0
    setTimeout("rotateslide()",pause)
    }
    }
    
    function rotateslide(){
    if (ie4||dom){
    resetit(curcanvas)
    crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
    crossobj.style.zIndex++
    if (crossobj.filters)
    document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20
    else if (crossobj.style.MozOpacity)
    document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2
    var temp='setInterval("moveslide()",50)'
    dropslide=eval(temp)
    curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
    }
    else if (document.layers){
    crossobj.document.write(scrollercontent[curindex])
    crossobj.document.close()
    }
    curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0
    }
    
    function resetit(what){
    curpos=parseInt(scroller_height)*(1)
    var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
    crossobj.style.top=curpos+"px"
    }
    
    function startit(){
    crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub
    if (ie4||dom){
    crossobj.innerHTML=scrollercontent[curindex]
    rotateslide()
    }
    else{
    document.tickernsmain.visibility='show'
    curindex++
    setInterval("rotateslide()",pause)
    }
    }
    
    if (ie4||dom||document.layers)
    window.onload=startit
    
    </script>
    </script>





    This is where you get to specify what it scrolls,
    Code:
    scrollercontent[0]='Visit the forums <a href="http://www.webmasterlingo.com">WebmasterLingo.com </a>for free web help!'
    scrollercontent[1]='Email Fabolous05 to get a new design, <a href="mailto:fabolous05@gmail.com">E-Mail</a>.'
    scrollercontent[2]='Google is the top search engine. Go give Google a try, <a href="http://www.google.com">Google</a>.'
    You can adjust some settings here as well
    Code:
    var scroller_width='150px'
    var scroller_height='115px'
    var bgcolor='#0099CC'
    var pause=3000 //milliseconds (3000=3 seconds)

    here is the script in action,
    http://members.shaw.ca/designs604/calendar/scroller/


    Fabolous05
    good luck!
    Fabo@VolantaStudios.com
    Head Designer
    Volantà Studios

  2. #2
    Full Member kitty is on a distinguished road
    Join Date
    Aug 2005
    Posts
    16
    in www.hotscripts.com u will find different codes u can use it

  3. #3
    Newbie daier1r is on a distinguished road
    Join Date
    Apr 2009
    Posts
    3
    I believe listening is powerful Medicine.

    Studies have shown it takes a physician about 18 seconds to interrupt a patient after he begins talking.

    It was Sunday. I had one last patient to see. I approached her room in a hurry and stood at the doorway. She was an older woman, sitting at the edge of the bed, struggling to put socks on her swollen feet.World of warcraft Power Leveling I crossed the threshold, spoke quickly to the nurse, scanned her chart noting she was in stable condition. I was almost in the clear.

    I leaned on the bedrail looking down at her. She asked if I could help put on her socks. Instead, I launched into a monologue that went something like this: "How are you feeling? Your sugars and blood pressure were high but they're better today. The nurse mentioned you're anxious to see your son who's visiting you today. It's nice to have family visit from far away. I bet you really look forward to seeing him."

    She stopped me with a stern, authoritative voice. wow power leveling,"Sit down, doctor. This is my story, not your story."

    I was surprised and embarrassed. I sat down. I helped her with the socks. She began to tell me that her only son lived around the corner from her, but she had not seen him in five years. She believed that the stress of this contributed greatly to her health problems. After hearing her story and putting on her socks, I asked if there was anything else I could do for her. She shook her head no and smiled. All she wanted me to do was to listen.

    Each story is different. Some are detailed; others are vague. Some have a beginning, middle and end. Others wander without a clear conclusion. Some are true; others not. Yet all those things do not really matter. What matters to the storyteller is that the story is heard — without interruption, assumption or judgment.

    Listening to someone's story costs less than expensive diagnostic testing but is key to healing and diagnosis.

    I often thought of what that woman taught me, and I reminded myself of the importance of stopping, sitting down and truly listening. And, not long after, in an unexpected twist, I became the patient, with a diagnosis of multiple sclerosis at age 31. Now, 20 years later, I sit all the time — in a wheelchair.

    For as long as I could, I continued to see patients from my chair, but I had to resign when my hands were affected. I still teach med students and other health care professionals, but now from the perspective of physician and patient.

    I tell them I believe in the power of listening. I tell them I know firsthand that immeasurable healing takes place within me when someone stops, sits down and listens to my story.
    The Internet, which was unfamiliar to human beings is totally accepted by most of people. Especially these days, it has been developing faster and faster, people do not have much time to do everything by themselves. So making full use of the Internet is a good way to color one’s life.

    For instance, students could learn more and more from all over the world so that they can broaden their horizon and enrich their knowledge. Absolutely, the bridge that connects the whole world is the Internet.

    Secondly, scientists and mathematicians, too, can share research results in order to promote the wheel of human society much more quickly.world of warcraft power leveling,

    I suppose the key factor of importance of Internet is to find a good job . In the society which is full of competition, more information means more opportunities. A job hunter can get on the Internet to browse for a favorable job.

    Well, from what has been mentioned above, I believe with the high speed and efficiency, the Internet will become more and more popular among people in the near future. wow power leveling

    I believe listening is powerful Medicine.

  4. #4
    Full Member .amaZe is on a distinguished road
    Join Date
    May 2009
    Posts
    24
    very nice tutorial

  5. #5
    Full Member MH-Andy is on a distinguished road
    Join Date
    May 2009
    Posts
    20
    Good info, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts