Previous Thread
Next Thread
Print Thread
Hop To
#202542 12/04/2007 5:18 AM
Joined: Jul 2004
Posts: 87
J
journeyman
journeyman
J Offline
Joined: Jul 2004
Posts: 87
Last question today ;-)

Is it possible to add some java script so _ can customise some scrolling messages on the board?


script below:
Code
<script language="JavaScript1.2">
<!--

/*
Typing Scroller
Submitted by bengaliboy00@hotmail.com (hp: http://www.angelfire.com/nt/bengaliboy/)
With modifications by Dynamicdrive.com
For full source code, usage terms, and 100s more scripts, visit http://dynamicdrive.com
*/

//Secify scroller contents
var line=new Array()
line[1]="This is an awsome script"
line[2]="It brings up the text you want..."
line[3]="One letter at a time"
line[4]="You can add and subtract lines as you like."
line[5]="It\'s very cool and easy to use"

//Specify font size for scoller
var ts_fontsize="16px"

//--Don't edit below this line

var longestmessage=1
for (i=2;i<line.length;i++){
if (line[i].length>line[longestmessage].length)
longestmessage=i
}

//Auto set scroller width
var tscroller_width=line[longestmessage].length

lines=line.length-1 //--Number of lines

//if IE 4+ or NS6
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>')
}

temp=""
nextchar=-1;
nextline=1;
cursor="\\"
function animate(){
if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
nextline++;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
nextline=1;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else{
nextstep()}}

function nextstep(){

if (cursor=="\\"){
cursor="|"}
else if (cursor=="|"){
cursor="/"}
else if (cursor=="/"){
cursor="-"}
else if (cursor=="-"){
cursor="\\"}


nextchar++;
temp+=line[nextline].charAt(nextchar);
document.bannerform.banner.value=temp+cursor
setTimeout("animate()",25)}

//if IE 4+ or NS6
if (document.all||document.getElementById)
window.onload=animate
// -->
</script>

Last edited by Gizmo; 12/04/2007 5:07 PM. Reason: Added [code] tags.
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Yes smile

Combine it with something that retrieves the news items somewhere frmo the forum, and you got a cool thing smile


[Linked Image from siemons.org]
Joined: Jul 2004
Posts: 87
J
journeyman
journeyman
J Offline
Joined: Jul 2004
Posts: 87
So I could just cut and paste the java above into the footer for example - won't make the board explode!?? <smile>


Joined: Jun 2006
Posts: 3,837
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,837
Yes - you can run scripts on any part of your forum - this is after all what many adverts such as Google Adsense is.

Joined: Jul 2004
Posts: 87
J
journeyman
journeyman
J Offline
Joined: Jul 2004
Posts: 87
thanks Ian/blaaskaak ;-)

Joined: Jul 2004
Posts: 87
J
journeyman
journeyman
J Offline
Joined: Jul 2004
Posts: 87
oh - last q?

Can I have image AND scroller as part of header?

Joined: Jun 2006
Posts: 3,837
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,837
You can have whatever you like in the header.

I have images, java and a ticker in some forums.

You should have no issues smile

Joined: Jul 2004
Posts: 87
J
journeyman
journeyman
J Offline
Joined: Jul 2004
Posts: 87
again thanks!

Joined: Dec 2006
Posts: 1,235
veteran
veteran
Joined: Dec 2006
Posts: 1,235
Even easier, use <marquee> tags.

Code
<marquee>
Type whatever you want here and it will scroll.
</marquee>

Joined: Jun 2006
Posts: 3,837
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,837
I thought marquee only worked in IE?

Joined: Dec 2006
Posts: 1,235
veteran
veteran
Joined: Dec 2006
Posts: 1,235
Same here but I thought I'd try it with Firefox before I posted and it worked.

Don't know about other browsers though but unless you're running an Apple forum, 98% of your visitors will be able to see it. If it works with Opera then it's visibility should shoot up to about 98.1% :lol:

Joined: Jun 2006
Posts: 3,837
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,837
I guess more browsers recognise it these days.

Joined: Nov 2006
Posts: 3,095
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095
Likes: 1
Marquee tag {wikipedia}
http://en.wikipedia.org/wiki/Marquee_tag


Compliance
Quote
The marquee element type was first invented for Microsoft's Internet Explorer and is still supported. The Mozilla Firefox, Opera, and Safari web browsers support it for legacy page compatibility, although many other browsers do not. The tag is considered unofficial in proper XHTML or HTML. An equivalent for the tag is however being designed for the future releases of Cascading Style Sheets. [1] Similar effects can also be achieved through the use of JavaScript on a webpage.

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Marquee tags are not xhtml compliant.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
I really need to read page 2 before posting wink...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
2 members (Havenofsobriety, rootman), 624 guests, and 106 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)