October 21, 2018, 09:27:31 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

[Code] Simple Announcements

Pages: [1]   Go Down
  Print  
Author Topic: [Code] Simple Announcements  (Read 263 times)
DzinestaR
Starter
Starter
Offline Offline

Gender: Male
Posts: 21


View Profile WWW
Badges: (View All)
« on: September 07, 2009, 10:10:35 pm »

Forum Url: http://SMFDesigns.smfforfree3.com

Code Demo!

This adds a scrolling text box to the top of your forum for quick announcements you may want your members to see right away.

Headers:

Code:
<SCRIPT LANGUAGE="JavaScript">

var myMainMessage="  YOUR SIMPLE ANNOUNCMENT TEXT HERE! ";
var speed=150;
var scrollingRegion=50;

var startPosition=0;
function mainTextScroller() {
        var mainMessage=myMainMessage;
        var tempLoc=(scrollingRegion*3/mainMessage.length)+1;
        if (tempLoc<1) {tempLoc=1}
        var counter;
        for(counter=0;counter<=tempLoc;counter++)
           mainMessage+=mainMessage;
document.mainForm.mainTextScroller.value=mainMessage.substring(startPosition,startPosition+scrollingRegion);
        startPosition++;
        if(startPosition>scrollingRegion) startPosition=0;
        setTimeout("mainTextScroller()",speed); }
</script>

</HEAD>

<BODY onLoad="mainTextScroller()">

<form name="mainForm">
<center>
<input type="text" name="mainTextScroller" size="40" value>
</center>
</form>

You can change the speed of the scroll of the text by modifying this:
Code:
var speed=150;

Change my pre-set text here:

Code:
var myMainMessage="  YOUR SIMPLE ANNOUNCMENT TEXT HERE! ";

Enjoy.

-DzinestaR
« Last Edit: September 07, 2009, 10:12:06 pm by DzinestaR » Report Spam   Logged

Social Buttons



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum | Buy traffic for your forum/website

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy