JavaScripts -> Animation -> Trennleiste mit animertem Farbverlauf
Dies ist eine Trennleiste wie das HTML-Element <hr>. Kann in den Farben konfiguriert werden, sowie mehrere Male auf der selben Seite eingesetzt werden. Jede Trennleiste ist dabei in Höhe und Animationsgeschwindigkeit konfigurierbar.
Kompatibilität getestet:
Script-Code
<script type="text/javascript">
<!--
//Animated Horizontal Ruler v1.0 (c) 2003 Triple-M
//Aufruf: hr(hoehe, geschwindigkeit);
//Syntax: hr(height, speed);
//cols: Die Farben. Sie koennen die Farben aendern oder welche entfernen bzw. hinzufuegen.
//cols: The colors. You may safely change, add or delete entries.
var cols=new Array("#ffcc66", "#e0b35a", "#c09a4e", "#a08142", "#806836", "#604f2a", "#40361e", "#200412", "#000000", "#200412", "#40361e", "#604f2a", "#806836", "#a08142", "#c09a4e", "#e0b35a");
//Andere Farbbeispiele / Other color examples
//var cols=new Array("#ffffff", "#e0e0e0", "#c0c0c0", "#a0a0a0", "#808080", "#606060", "#404040", "#201d20", "#000000", "#202020", "#404040", "#606060", "#808080", "#a0a0a0", "#c0c0c0", "#e0e0e0");
//var cols=new Array("#ff0000", "#e00020", "#c00040", "#a00060", "#800080", "#6000a0", "#4000c0", "#2000e0", "#0000ff", "#2000e0", "#4000c0", "#6000a0", "#800080", "#a00060", "#c00040", "#e00020");
var off=new Array;
function rotate(idprefix) {
if (isNaN(off[idprefix])) {
off[idprefix]=1;
}
for(i=0;i<cols.length;i++) {
id=idprefix+i;
document.getElementById(id).style.backgroundColor=cols[(i+off[idprefix])%cols.length];
}
off[idprefix]++;
if(off[idprefix]>=cols.length)off[idprefix]=0;
}
function hr(height,spd) {
var idprefix="hrauto"+Math.floor(Math.random()*65535)+"id";
document.write('<table cellspacing="0" cellpadding="0" width="100%" style="border-spacing:0px; border-collapse:collapse; width:100%; height:'+height+'px"><tr>');
for(i=0;i<cols.length;i++) {
document.write('<td id="'+idprefix+i+'" style="background-color:'+cols[i]+'; font-size:1px; padding:0px"> </td>');
}
document.write('</tr></table>');
f="rotate('"+idprefix+"')";
window.setInterval(f,spd);
}
//-->
</script>
<!--
//Animated Horizontal Ruler v1.0 (c) 2003 Triple-M
//Aufruf: hr(hoehe, geschwindigkeit);
//Syntax: hr(height, speed);
//cols: Die Farben. Sie koennen die Farben aendern oder welche entfernen bzw. hinzufuegen.
//cols: The colors. You may safely change, add or delete entries.
var cols=new Array("#ffcc66", "#e0b35a", "#c09a4e", "#a08142", "#806836", "#604f2a", "#40361e", "#200412", "#000000", "#200412", "#40361e", "#604f2a", "#806836", "#a08142", "#c09a4e", "#e0b35a");
//Andere Farbbeispiele / Other color examples
//var cols=new Array("#ffffff", "#e0e0e0", "#c0c0c0", "#a0a0a0", "#808080", "#606060", "#404040", "#201d20", "#000000", "#202020", "#404040", "#606060", "#808080", "#a0a0a0", "#c0c0c0", "#e0e0e0");
//var cols=new Array("#ff0000", "#e00020", "#c00040", "#a00060", "#800080", "#6000a0", "#4000c0", "#2000e0", "#0000ff", "#2000e0", "#4000c0", "#6000a0", "#800080", "#a00060", "#c00040", "#e00020");
var off=new Array;
function rotate(idprefix) {
if (isNaN(off[idprefix])) {
off[idprefix]=1;
}
for(i=0;i<cols.length;i++) {
id=idprefix+i;
document.getElementById(id).style.backgroundColor=cols[(i+off[idprefix])%cols.length];
}
off[idprefix]++;
if(off[idprefix]>=cols.length)off[idprefix]=0;
}
function hr(height,spd) {
var idprefix="hrauto"+Math.floor(Math.random()*65535)+"id";
document.write('<table cellspacing="0" cellpadding="0" width="100%" style="border-spacing:0px; border-collapse:collapse; width:100%; height:'+height+'px"><tr>');
for(i=0;i<cols.length;i++) {
document.write('<td id="'+idprefix+i+'" style="background-color:'+cols[i]+'; font-size:1px; padding:0px"> </td>');
}
document.write('</tr></table>');
f="rotate('"+idprefix+"')";
window.setInterval(f,spd);
}
//-->
</script>