Advertise Here

Author Topic: [Code] Simple Anouncements  (Read 5627 times)

0 Members and 1 Guest are viewing this topic.

Offline DzinestaR

  • Style Designer
  • *
  • Posts: 91
    • View Profile
    • SMF Designs

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
[Code] Simple Anouncements
« on: August 27, 2009, 10:20:47 pm »
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: [Select]
<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: [Select]
var speed=150;
Change my pre-set text here:

Code: [Select]
var myMainMessage="  YOUR SIMPLE ANNOUNCMENT TEXT HERE! ";
Enjoy.

-DzinestaR

Offline THE WIZARD

  • SMF For Free Member
  • *
  • Posts: 75
    • View Profile
    • Admin

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Simple Anouncements
« Reply #1 on: August 28, 2009, 03:52:51 am »
Forum Url: http://wwwthetimezone.smfforfree4.com/index.php
Very nice work there DzinestaR

Offline DzinestaR

  • Style Designer
  • *
  • Posts: 91
    • View Profile
    • SMF Designs

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Simple Anouncements
« Reply #2 on: August 28, 2009, 10:23:58 pm »
Thanks.

-DzinestaR

Offline ady

  • SMF For Free Full Member
  • *
  • Posts: 206
    • View Profile

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Simple Anouncements
« Reply #3 on: January 14, 2010, 11:39:01 am »
Hi there, great idea.  

I put the script in the header.................right? and then change the pre-set text, but no text appearing. Any ideas please?

Ady
« Last Edit: January 14, 2010, 12:03:52 pm by ady »
If any of you are passing by my house, please feel free to pass.

Offline Zion

  • SMF For Free Full Member
  • *
  • Posts: 104
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: [Code] Simple Anouncements
« Reply #4 on: January 23, 2010, 01:39:38 am »
Very good ;)
I'm Back and trying harder.

Offline schart28

  • SMF For Free Newbie
  • *
  • Posts: 2
    • View Profile

  • Total Badges: 4
    Badges: (View All)
    Topic Starter Level 1 First Post One year Anniversary
Re: [Code] Simple Anouncements
« Reply #5 on: February 20, 2011, 04:18:45 pm »
Hi,

How would a put a color to part of the text?

thanks

Sylvain

Offline Andrew

  • Helpers
  • *
  • Posts: 2060
  • Andrew at your service
    • View Profile
    • Alabama Weather Prediction

  • Total Badges: 32
    Badges: (View All)
    10 Poll Votes Level 6 Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Simple Anouncements
« Reply #6 on: February 21, 2011, 10:15:05 am »
Code: [Select]
var myMainMessage="  YOUR SIMPLE ANNOUNCMENT TEXT HERE! ";
You can use:
Code: [Select]
var myMainMessage="<font color='COLOR'>YOUR SIMPLE ANNOUNCEMENT TEXT HERE";
Remember to use single quotation marks.

Offline clairebear

  • SMF For Free Master
  • *
  • Posts: 1019
    • View Profile

  • Total Badges: 23
    Badges: (View All)
    Fifth year Anniversary Search Level 5 1000 Posts Poll Voter
Re: [Code] Simple Anouncements
« Reply #7 on: February 23, 2011, 10:38:46 am »
i see nothing on demo
www.teardrop.mysmf.com

A support forum for support in loss from early miscarriage to five years.

Offline Mago

  • SMF For Free Full Member
  • *
  • Posts: 137
    • View Profile

  • Total Badges: 18
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Level 4 Fourth year Anniversary Search
Re: [Code] Simple Anouncements
« Reply #8 on: February 24, 2011, 05:45:23 am »
Forum Url: http://irishroadracers.smfforfree.com/index.php
Is there a way to change the background colour? I wish to use Black

Offline clairebear

  • SMF For Free Master
  • *
  • Posts: 1019
    • View Profile

  • Total Badges: 23
    Badges: (View All)
    Fifth year Anniversary Search Level 5 1000 Posts Poll Voter
Re: [Code] Simple Anouncements
« Reply #9 on: February 28, 2011, 04:04:17 am »
changing background colour would be great!
Also is there a way to add an image?
www.teardrop.mysmf.com

A support forum for support in loss from early miscarriage to five years.

Offline clairebear

  • SMF For Free Master
  • *
  • Posts: 1019
    • View Profile

  • Total Badges: 23
    Badges: (View All)
    Fifth year Anniversary Search Level 5 1000 Posts Poll Voter
Re: [Code] Simple Anouncements
« Reply #10 on: February 28, 2011, 04:12:40 am »
i put this
ar myMainMessage="<font color='Purple'> Ellie Nadine Marritt 5/11/2004 ";
but it just showing words not color
i tried color codes too n showing words
www.teardrop.mysmf.com

A support forum for support in loss from early miscarriage to five years.

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
2795 Views
Last post October 10, 2006, 11:41:34 am
by punkrock
19 Replies
5589 Views
Last post June 07, 2007, 10:01:16 pm
by deathwilldie
5 Replies
1509 Views
Last post September 28, 2007, 10:51:53 pm
by Kimmie
5 Replies
1802 Views
Last post March 31, 2009, 03:56:35 am
by мσנσвσנσ82
3 Replies
1610 Views
Last post November 12, 2009, 08:14:02 am
by i feel pure