Posted 12 years ago
·
Author
This code tweaks the messages panel and shows every message with a delay of 30 seconds in-between.
You do not need any of the following code, it is just a backup of the javascript files.
<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