Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Marquee

  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Marquee

    Alright, Basically, I'm trying to make a marquee (right now its just regular HTML, But I'm willing to change it)

    I want it so, when its done a loop, it will execute a function.

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Posts
    638
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You might be better served by displaying your current code, and describing the functional concept to be applied...
    hmm... ?

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Heres its Java component. I want it to change articles randomly visa vie the array.

    Code:
    var ticker = new Array ();
     for (var r=0; r < 100; r ++) {
      ticker[r] = "hello, my Value is: " + r + "!!!";
     }
    function SDH_chooseItemTick() {
     	var randA = Math.random()*ticker.length;
    	var chosen = Math.random()*randA;
    	tickerMarquee.innerHTML = ticker[Math.round(chosen)]
    }
    And heres the marquee component:

    Code:
    <marquee width="100%" scrolldelay="40" scrollamount="2"  style=" 
      font-size: 7pt; 
      verticle-align: 
      middle;" 
    id="tickerMarquee">
    
    GalacNetworks News Ticker
    
    </marquee>

  • #4
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <marquee onStart="SDH_chooseItemTick()">

    Works in IE4 and up. You dont get the original message though because it changes straight away, but that's easily fixed by by just putting an if statement in the function

    ctrl=1;

    function SDH_chooseItemTick() {
    if(ctrl==1){
    tickerMarquee.innerHTML = 'GalacNetworks News Ticker';
    ctrl++;
    }else{
    var randA = Math.random()*ticker.length;
    var chosen = Math.random()*randA;
    tickerMarquee.innerHTML = ticker[Math.round(chosen)];
    ctrl++;
    }
    }

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You may want to see bunch of cross-browser scroller scripts at dynamicdrive
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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