View Full Version : Alternating Marquee!
weedave
03-28-2007, 10:46 AM
Hi guys, i was just wondering if any one knew how to create an alternating marquee in DHTML, by alternating i mean one that alternates between different lines of text.
im trying to create a news marquee for a site im making for my dissertation and im properly lost with it
any help would be appreciated, cheers
djr33
03-28-2007, 10:51 AM
Could you not just combine the two lines into one that keeps scrolling?
Add some spaces between them, so you get them spaced out ("seperate") if you desire.
weedave
03-28-2007, 09:54 PM
yeah thats my backup plan just to lump them all into a normal marquee but it would look better if i could get it to work the other way. anyone any ideas at all?
Objectivity
03-29-2007, 01:54 PM
You could write a script that pulls the text randomly from a csv file.
jscheuer1
03-29-2007, 10:10 PM
You should have a look at the scripts on this index and see if any of them might work for you or be close:
http://www.dynamicdrive.com/dynamicindex2/index.html
weedave
03-30-2007, 09:29 PM
thanks a lot, theres a few there that i could use, will just need to configure the code and mix and match from a few of them, thanks :)
weedave
04-05-2007, 02:25 PM
back to bother you guys again. I decided to go with this code for my banner http://www.dynamicdrive.com/dynamicindex2/typescroll.htm (http://www.dynamicdrive.com/dynamicindex2/typescroll.htm) but i cant seem to modify it very much, im trying to modify the background colour and the font and the speed (although i havnt looked at the speed much yet). The way the style for the font seems to be set is in variables i.e. var_ts fontsize="14px". how would i go about changing other properties of this scroller?
Cheers
jscheuer1
04-05-2007, 03:12 PM
The background-color and color are set here to match the page:
if (document.all||document.getElementById){
document.write('<form name="bannerform">')
document.write('<input type="text" name="banner" size="'+tscroller_width+'"')
document.write(' style="background-color: '+document.bgColor+'; color: '+document.body.text+'; font-family: verdana; font-size: '+ts_fontsize+'; font-weight:bold; border: medium none" onfocus="blur()">')
document.write('</form>')
}
You can hard code your own preferences like so:
if (document.all||document.getElementById){
document.write('<form name="bannerform">')
document.write('<input type="text" name="banner" size="'+tscroller_width+'"')
document.write(' style="background-color: lightblue; color: navy; font-family: verdana; font-size: '+ts_fontsize+'; font-weight:bold; border: medium none" onfocus="blur()">')
document.write('</form>')
}
There are two speed vectors in the script. One is how long between each message and is represented by the two:
setTimeout("nextstep()",1000)}
statements. The larger this number, the longer the lag between messages. Both statements should be set to the same number. It represents milliseconds.
The other speed vector is how rapidly each letter gets banged out. It is set here:
setTimeout("animate()",25)}
Once again, the larger this number, the slower this vector will be.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.