Message Switcher

Don Von Alpha Dom
by Don Von Alpha Dom · 2 posts
12 years ago in Messages Panel
Posted 12 years ago · Author
This code tweaks the messages panel and shows every message with a delay of 30 seconds in-between.

Code
<script type="text/javascript" src="http://data.imvucodes.net/js/prototype/prototype.js"></script>
<script type="text/javascript" src="http://data.imvucodes.net/js/prototype/scriptaculous.js"></script>

<script type="text/javascript">
var currentMsgNum = 0;
var maxMsgNum = 0;
var madeBy = 'www.imvucodes.net';
function prepareMessages() {
  var objs = $('messages_panel_body').getElementsByClassName('msgWrap');
  maxMsgNum = objs.length - 1;
  for (i = 0; i <= maxMsgNum; i++) {
    objs[i].id = 'msgScroller_' + i;
    Effect.Fade(objs[i].id, { duration:0.1 });
  }
}
function nextMsg() {
  if (currentMsgNum == maxMsgNum) {
    var newMsg = 0;
  } else {
    var newMsg = currentMsgNum + 1;
  }
  new Effect.Fade('msgScroller_' + currentMsgNum, { duration: 1.0 });
  new Effect.Appear('msgScroller_' + newMsg, { duration: 1.0 });
  currentMsgNum = newMsg ;
}
prepareMessages();
nextMsg();
window.setInterval('nextMsg()', 30000);
</script>
<style type="text/css">
  #messages_panel_body {
    height:180px!important;
  }
  .msgWrap {
    position:absolute!important;
    top:30px!important;
    border-top:none!important;
    width:100%;
  }
</style>


You do not need any of the following code, it is just a backup of the javascript files.
javascript.zip
Posted 9 years ago
hmm, you dont need any of the following codes? lol, you're right about that..I need a damn good teacher.

are there any here?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT