1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| var tWidth = '100%'; // width (in pixels)
var tHeight = '25px'; // height (in pixels)
var tcolour = 'scripts/jquery/ui/layout/img/d6d6d6_40x100_textures_02_glass_80.png'; // background image:
var moStop = true; // pause on mouseover (true or false)
var fontfamily = 'arial,sans-serif'; // font for content
var tSpeed = 3; // scroll speed (1 = slow, 5 = fast)
var cps = tSpeed;
var aw, mq;
var fsz = parseInt(tHeight) - 4;
var lefttime;
var content = "COUCOU";
function startticker(content) {
if (document.getElementById) {
var tick = '<div style="position:relative;width:' + tWidth + ';height:' + tHeight + ';overflow:hidden;background-image:' + tcolour + '"';
if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"';
tick += '><div id="mq" style="position:absolute;left:0px;top:0px;font-family:' + fontfamily + ';font-size:' + fsz + 'px;white-space:nowrap;"><\/div><\/div>';
document.getElementById('message').innerHTML = tick;
mq = document.getElementById("mq"); mq.style.left = (parseInt(tWidth) + 100) + "px";
mq.innerHTML = '<span id="tx">' + content + '<\/span>'; aw = document.getElementById("tx").offsetWidth;
try {
clearInterval(lefttime);
}
catch (error) { }
lefttime = setInterval("scrollticker()", 70);
}
}
setTimeout("startticker(' Salut ');", 1000);
setTimeout("startticker(' Developpez.com ');", 5000); |
Partager