Jump to content


Photo

Marquee (horizontal scroller) new and improved


This topic has been archived. This means that you cannot reply to this topic.
159 replies to this topic

#1 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 30 August 2007 - 05:04 PM

I have reworked the marquee (horizontal scroller) code entirely in javascript.

What are the benefits of this:
- No iframes
- Less bandwidth usage for my site
- Quicker loading and uses less of MFL's resources
- Easier to implement for the end user
- Two row display (header row & scrolling row) or one row display
- Reloading bugs in old iframe scroller have been corrected

The first few lines of the code have variables that you can change.

A little further down is a CSS section where you can add some customization if you want.


Just copy and paste the code into a home page message
(turn off your advanced editor)


Here is the code for those interested:

Last modified: September 9, 2008

<script language="JavaScript" type="text/javascript">
<!--

//FYI: Script update as of September 9, 2008

//Start marquee manually 
   var marqueeClickToStart = false;

//SET THE #OF NEWS ITEMS TO DISPLAY 0=all; -1=none;
var marqueeNews = 5;

//SET THE #OF WEEKLY YARDAGE LEADERS TO DISPLAY 0=all; -1=none;
var marqueeLiveLeaders = 10;

//SET THE MODULES WOULD LIKE TO DISPLAY (true or false);
var marqueeScoreboardModule = false;
var marqueeWeeklyLeadersModule = true;
var marqueeSeasonLeadersModule = true;
var marqueeDraftResultsModule = false;

//Marquee Dimensions width either % or px; height only px
  var marqueeWidth="100%"
  var marqueeHeight="14px"

//Seconds to pause on new message
  var pauseTimeOnNewMessage = 4;

//Marquee speed (larger is faster 1-10)
  var marqueeSpeed=2

//Separate Header and Body (false for 1-line display) 
  var separateMarqueeHeader = true;

//Display marquee on home page only (useful only if marquee is in header)
  var marqueeHomeOnly = true;

//OTHER SETTINGS
//Personal Message #1 (appears as first message scrolled)
   var marqueeTitle1 = "";
   var marqueeMessage1 = "";

   var marqueeTitle1a = "";
   var marqueeMessage1a = "";

   var marqueeTitle1b = "";
   var marqueeMessage1b = "";

   var marqueeTitle1c = "";
   var marqueeMessage1c = "";

//Personal Message #2 (appears as last message scrolled)
   var marqueeTitle2 = "";
   var marqueeMessage2 = "";

   var marqueeTitle2a = "";
   var marqueeMessage2a = "";

//Set the home field advantage here
   var homeFieldAdvantage = 0; 

//Set the number of decimal places
   var marqueeDecimals = 0;

//Hide ties when displaying (W-L-T) 
   var hideTiesInRecord = false; 

//Hide point spreads for upcoming games
   var hideMarqueeSpread = false; 

//# of top players to display
   var marqueeWeeklyTopPlayers = 5;
   var marqueeSeasonTopPlayers = 5;

//Top Player Settings (use setting 0,1,2,3,4 or 5 for marqueeTopPlayerMode)  
   // 0: show all players starters/nonstarters/rostered/free agents
   // 1: show rostered players/FA's in separate scroll
   // 2: show only rostered players whether started or benched
   // 3: show only free agent players
   // 4: show only rostered players but separate starters and bench
   // 5: show rostered players/FA's in seperate scroll; separate starters/bench
   var marqueeTopWeeklyMode = 5;
   var marqueeTopSeasonMode = 1;

//Draft Display Settings (use setting 0,1,2,3 or 4 for marqueeDraftFilter)
   // 0: show all; 
   // 1: show upto and including last pick
   // 2: show upto and including last pick + next pick
   // 3: show upto and including last pick + next 2 picks
   // 4: show only rounds indicated by start and end variables
   var marqueeDraftFilter = 0;
   var marqueeDraftStart = 1;
   var marqueeDraftEnd   = 1;

//-->
</script>


<style type='text/css'>

#marqueeheader {
   background-color: #CBCCBA;
   color: #323321;
   font-style: italic;
   font-weight: bold;   
}

#marqueebody, #marqueebody a:link, #marqueebody a:visited, #marqueebody a:active {
   background-color: #323321;
   font-weight: bold;
   color: #C9C693;
   text-decoration: none;
}

#marqueebody a:hover {
   color: red;
}

#marqueetable {
  border: 1px solid black;
  border-bottom: 0px;
}
</style>

<script language="JavaScript" type="text/javascript" src="http://www.habman.com/mfl/apps/js/habman_common.js"></script>
<script language="JavaScript" type="text/javascript" src="http://www.habman.com/mfl/apps/js/marquee.js"></script>

September 9th:

Player News Added: To control the items to display or hide it all together add this bit of code
//SET THE #OF NEWS ITEMS TO DISPLAY 0=all; -1=none;
var marqueeNews = 5;



September 30th:
Live Weekly Yardage Leaders added: To control the items to display or hide it all together add this bit of code
//SET THE #OF WEEKLY YARDAGE LEADERS TO DISPLAY 0=all; -1=none;
var marqueeLiveLeaders = 10;




November 10th:
Added ability to automatically set the days of the week for the Click to Start option.

Replace:
var marqueeClickToStart = false;
with
var marqueeClickToStart = new Array(false,false,true,true,true,true,true);
In the above example the marquee will display normally on Sunday & Monday and use the "Click to Start" for the other days.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#2 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 30 August 2007 - 05:21 PM

Any FAQ's will be answered here.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#3 Game Time

Game Time

    Veteran

  • Members
  • PipPipPip
  • 783 posts

Posted 30 August 2007 - 07:26 PM

you must hate me by now... LOL

posted it and nothing appears... all i did was change the colors, nothing else
Visit Nitro Grafixx....

http://nitrografixx.com

#4 Ironhedz

Ironhedz

    Veteran

  • Members
  • PipPipPip
  • 100 posts

Posted 30 August 2007 - 08:45 PM

Habman - Same thing as the post above - nothing happened - is there a place to enter - league id, server id, year, etc.. Once again YOU ARE THE MAN

#5 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 30 August 2007 - 08:52 PM

you must hate me by now... LOL

posted it and nothing appears... all i did was change the colors, nothing else


LOL. No it's good to get this kind of feedback. It helps me work out any glitches.

I sent you a PM for you to try something which will allow me to find the error more easily.

Let me know when you have it done.

Thanks





Habman - Same thing as the post above - nothing happened - is there a place to enter - league id, server id, year, etc.. Once again YOU ARE THE MAN

Can I get your league id. I would like to see if the error you are getting is the same as Game Time.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#6 RepoMan

RepoMan

    Veteran

  • Members
  • PipPipPip
  • 148 posts

Posted 30 August 2007 - 10:01 PM


you must hate me by now... LOL

posted it and nothing appears... all i did was change the colors, nothing else


LOL. No it's good to get this kind of feedback. It helps me work out any glitches.

I sent you a PM for you to try something which will allow me to find the error more easily.

Let me know when you have it done.

Thanks


Habman - Same thing as the post above - nothing happened - is there a place to enter - league id, server id, year, etc.. Once again YOU ARE THE MAN

Can I get your league id. I would like to see if the error you are getting is the same as Game Time.


Habman,
I'm getting the same thing. I changed a few more things than color. All i get is the box with no data.

Thanks

#7 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 30 August 2007 - 10:32 PM

The errors reported should be corrected.

Please do a CTRL-F5 to clear your cache.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#8 RepoMan

RepoMan

    Veteran

  • Members
  • PipPipPip
  • 148 posts

Posted 30 August 2007 - 10:34 PM

The errors reported should be corrected.

Please do a CTRL-F5 to clear your cache.



Working perfect thanks

#9 jbhodj

jbhodj

    Member

  • Members
  • PipPip
  • 24 posts

Posted 31 August 2007 - 12:31 PM

stupid question maybe sorry, but when you say homepage module, your speaking about a home page message? correct

#10 jbhodj

jbhodj

    Member

  • Members
  • PipPip
  • 24 posts

Posted 31 August 2007 - 12:44 PM

stupid question maybe sorry, but when you say homepage module, your speaking about a home page message? correct

#11 gridfather

gridfather

    Veteran

  • Members
  • PipPipPip
  • 116 posts

Posted 31 August 2007 - 01:00 PM

yes.

it took me a long time to figure that out last season :ph34r:

#12 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 31 August 2007 - 01:20 PM

stupid question maybe sorry, but when you say homepage module, your speaking about a home page message? correct


yes.

it took me a long time to figure that out last season :ph34r:


Oops never realized that I was writing down module rather than message.

Home page message is correct.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#13 nolanbuc

nolanbuc

    Veteran

  • Members
  • PipPipPip
  • 146 posts

Posted 31 August 2007 - 01:32 PM

Great work as always, Habman. One request please: any way we could get more "personal messages"...say 4 or 5? :)

Not sure if it's feasible, but it would be really cool if the top line flashed like it was a breaking news bulletin. B)

Thanks for all you do!
World Fantasy Football League
worldfantasysports.net

#14 Game Time

Game Time

    Veteran

  • Members
  • PipPipPip
  • 783 posts

Posted 31 August 2007 - 01:42 PM

is it supposed to stop after it goes thorugh or continue and just restart? Mine stops after the draft...
Visit Nitro Grafixx....

http://nitrografixx.com

#15 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 31 August 2007 - 01:54 PM

is it supposed to stop after it goes thorugh or continue and just restart? Mine stops after the draft...


No it is supposed to restart. I checked your site out before and there was a long delay after the draft but it did restart eventually (30 seconds or so).

It think the is due to the fact that you are displaying your entire draft which is quite long and it is causeing the script to lose track of it's positioning. I will see if I can get a fix.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/