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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    England =)
    Posts
    523
    Thanks
    26
    Thanked 0 Times in 0 Posts

    :: looking for a random news script ::

    hi peeps

    basially i want a script that will display random pieces of news in a kind of marquee styleee on various pages on one of my sites.

    i think i could make one that just displays 1 random piece of news but i would like it to ideally scroll and im totally out of practice as ive hardly done any dev work in the last 8 months or so

    cheers peeps!
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    England =)
    Posts
    523
    Thanks
    26
    Thanked 0 Times in 0 Posts
    hmmm - the things with these scripts on all the pages is that they loop the news in the same order....

    this is pointless as users only ever see the same few messages messages later on in the list never get seen by anybody

    anyone else got any ideas?
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson

  • #4
    Regular Coder Skyzyx's Avatar
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could use one of the scripts above, and just add an array randomizer.

    Code:
    // RANDOMIZE ARRAY VALUES
    function xRandom(zArrayName)
    {
    	temp='';
    	for (i=0; i<1; i++) temp+=zArrayName[(Math.floor(Math.random()*(zArrayName.length)))];
    	return temp;
    }

    Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.


  •  

    Posting Permissions

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