free web
free web
free web
[ Tin mới · Thành viên · Nội quy · Tìm kiếm · RSS ]
Page 1 of 11
Forum » Giao lưu chia sẻ kinh nghiệm về website » Tổng hợp code và javascript » Chèn hiệu ứng chữ chạy màu đẹp java cho web
Chèn hiệu ứng chữ chạy màu đẹp java cho web
Bom_cute36 Date: Thứ sáu, 06.Jan.2017, 2:24 PM | Message # 1
Offline
Cấp độ: ₷oáiҪa
Bài viết: 13
Coppy và chèn đoạn java này vào nơi ban muốn tạo chỉnh sửa tiêu đề chữ tùy theo ý thích của bạn nhé.

[ - DEMO - ]

CODE 1
Code
<script language="JavaScript1.2">
/Flashing Neon /
var message="Coppyright © - http://ibiz.ucoz.net - ® 2016"
var neonbasecolor="#d7d7d7"
var neontextcolor="#fff900"
var neontexsize="10"
var neontextcolor2="red"
var flashspeed=65                  // speed of flashing in milliseconds
var flashingletters=3                  // number of letters flashing in neontextcolor
var flashingletters2=5                    // number of letters flashing in neontextcolor2 (0 to disable)
var flashpause=0                  // the pause between flash-cycles in milliseconds
///No need to edit below this line/////
var n=0
if (document.all||document.getElementById){
document.write('<font color="'+neonbasecolor+neontexsize+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
document.write('</font>')
}
else
document.write(message)
function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}
function neon(){
//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
crossref(m).style.color=neonbasecolor
}
//cycle through and change individual letters to neon color
crossref(n).style.color=neontextcolor
if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2
if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor
if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",flashpause)
return
}
}
function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>

CODE 2
Code
<script type="text/javascript">
<!-- Begin
/*
/*
 * Notes on hue
 *
 * This script uses hue rotation in the following manner:
 * hue=0   is red (#FF0000)
 * hue=60  is yellow (#FFFF00)
 * hue=120 is green (#00FF00)
 * hue=180 is cyan (#00FFFF)
 * hue=240 is blue (#0000FF)
 * hue=300 is magenta (#FF00FF)
 * hue=360 is hue=0 (#FF0000)
 *
 * Notes on the script
 *
 * This script should function in any browser that supports document.getElementById
 * Đã Test Netscape7, Mozilla Firefox 1.0, and Internet Explorer 6
 *
 * Accessibility
 *
 * The script does not write the string out, but rather takes it from an existing
 * HTML element. Therefore, users with javascript disabled will not be adverely affected.
 * They just won't get the pretty colors.
 */
/*
 * splits par.firstChild.data into 1 span for each letter
 * ARGUMENTS
 *   span - HTML element containing a text node as the only element
 */
function toSpans(span) {
  var str=span.firstChild.data;
  var a=str.length;
  span.removeChild(span.firstChild);
  for(var i=0; i<a; i++) {
    var theSpan=document.createElement("SPAN");
    theSpan.appendChild(document.createTextNode(str.charAt(i)));
    span.appendChild(theSpan);
  }
}
/*
 * creates a rainbowspan object
 * whose letters will be colored  [deg]degrees of hue
 * ARGUMENTS
 *   span - HTML element to apply the effect to (text only, no HTML)
 *   hue - what degree of hue to start at (0-359)
 *   deg - how many hue degrees should be traversed from beginning to end of the string (360 => once around, 720 => twice, etc)
 *   brt - brightness (0-255, 0 => black, 255 => full color)
 *   spd - how many ms between moveRainbow calls (less => faster)
 *   hspd - how many hue degrees to move every time moveRainbow is called (0-359, closer to 180 => faster)
 */
function RainbowSpan(span, hue, deg, brt, spd, hspd) {
    this.deg=(deg==null?360:Math.abs(deg));
    this.hue=(hue==null?0:Math.abs(hue)%360);
    this.hspd=(hspd==null?3:Math.abs(hspd)%360);
    this.length=span.firstChild.data.length;
    this.span=span;
    this.speed=(spd==null?50:Math.abs(spd));
    this.hInc=this.deg/this.length;
    this.brt=(brt==null?255:Math.abs(brt)%256);
    this.timer=null;
    toSpans(span);
    this.moveRainbow();
}
/*
 * sets the colors of the children of  [this]as a hue-rotating rainbow starting at this.hue;
 * requires something to manage ch externally
 * I had to make the RainbowSpan class because M$IE wouldn't let me attach this prototype to 
 [Object]*/
RainbowSpan.prototype.moveRainbow = function() {
  if(this.hue>359) this.hue-=360;
  var color;
  var b=this.brt;
  var a=this.length;
  var h=this.hue;
  for(var i=0; i<a; i++) {
    if(h>359) h-=360;
    if(h<60) { color=Math.floor(((h)/60)*b); red=b;grn=color;blu=0; }
    else if(h<120) { color=Math.floor(((h-60)/60)*b); red=b-color;grn=b;blu=0; }
    else if(h<180) { color=Math.floor(((h-120)/60)*b); red=0;grn=b;blu=color; }
    else if(h<240) { color=Math.floor(((h-180)/60)*b); red=0;grn=b-color;blu=b; }
    else if(h<300) { color=Math.floor(((h-240)/60)*b); red=color;grn=0;blu=b; }
    else { color=Math.floor(((h-300)/60)*b); red=b;grn=0;blu=b-color; }
    h+=this.hInc;
    this.span.childNodes[i].style.color="rgb("+red+", "+grn+", "+blu+")";
  }
  this.hue+=this.hspd;
}
// End -->
</script>
<pp id="r2">๑۩۞۩๑ -[ Admin™ - Nguyễn Văn Thanh ]- ๑۩۞۩๑</pp>
<script type="text/javascript">
var r2=document.getElementById("r2"); //get span to apply rainbow
var myRainbowSpan2=new RainbowSpan(r2, 0, 360, 255, 50, 348); //apply static rainbow effect
myRainbowSpan2.timer=window.setInterval("myRainbowSpan2.moveRainbow()", myRainbowSpan2.speed);
</script>

CODE 3
Code
<script type="text/javascript">
farbbibliothek = new Array();
farbbibliothek[0] = new Array("#FF0000", "#FF1100", "#FF2200", "#FF3300", "#FF4400", "#FF5500", "#FF6600", "#FF7700", "#FF8800", "#FF9900", "#FFaa00", "#FFbb00", "#FFcc00", "#FFdd00", "#FFee00", "#FFff00", "#FFee00", "#FFdd00", "#FFcc00", "#FFbb00", "#FFaa00", "#FF9900", "#FF8800", "#FF7700", "#FF6600", "#FF5500", "#FF4400", "#FF3300", "#FF2200", "#FF1100");
farbbibliothek[1] = new Array("#00FF00", "#000000", "#00FF00", "#00FF00");
farbbibliothek[2] = new Array("#00FF00", "#FF0000", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00", "#00FF00");
farbbibliothek[3] = new Array("#FF0000", "#FF4000", "#FF8000", "#FFC000", "#FFFF00", "#C0FF00", "#80FF00", "#40FF00", "#00FF00", "#00FF40", "#00FF80", "#00FFC0", "#00FFFF", "#00C0FF", "#0080FF", "#0040FF", "#0000FF", "#4000FF", "#8000FF", "#C000FF", "#FF00FF", "#FF00C0", "#FF0080", "#FF0040");
farbbibliothek[4] = new Array("#FF0000", "#EE0000", "#DD0000", "#CC0000", "#BB0000", "#AA0000", "#990000", "#880000", "#770000", "#660000", "#550000", "#440000", "#330000", "#220000", "#110000", "#000000", "#110000", "#220000", "#330000", "#440000", "#550000", "#660000", "#770000", "#880000", "#990000", "#AA0000", "#BB0000", "#CC0000", "#DD0000", "#EE0000");
farbbibliothek[5] = new Array("#000000", "#000000", "#000000", "#FFFFFF", "#FFFFFF", "#FFFFFF");
farbbibliothek[6] = new Array("#0000FF", "#FFFF00");
farben = farbbibliothek[4];

function farbschrift() {
for (var i = 0; i < Buchstabe.length; i++) {
document.all["a" + i].style.color = farben[i];
}
farbverlauf();
}

function string2array(text) {
Buchstabe = new Array();
while (farben.length < text.length) {
farben = farben.concat(farben);
}
k = 0;
while (k <= text.length) {
Buchstabe [k]= text.charAt(k);
k++;
}
}

function divserzeugen() {
for (var i = 0; i < Buchstabe.length; i++) {
document.write("<span id='a" + i + "' class='a" + i + "'>" + Buchstabe [i]+ "</span>");
}
farbschrift();
}
var a = 1;

function farbverlauf() {
for (var i = 0; i < farben.length; i++) {
farben[i - 1] = farben[i];
}
farben[farben.length - 1] = farben[-1];

setTimeout("farbschrift()", 30);
}
//
var farbsatz = 1;

function farbtauscher() {
farben = farbbibliothek[farbsatz];
while (farben.length < text.length) {
farben = farben.concat(farben);
}
farbsatz = Math.floor(Math.random() * (farbbibliothek.length - 0.0001));
}
setInterval("farbtauscher()", 2000);
text = "☆ -=[-:-☠Đẳng Cấp Dân IT☠-:-]=- ☆"; //h
string2array(text);
divserzeugen();
//document.write(text);

</script>


Boy cute không e dè - rất sợ té
 
Forum » Giao lưu chia sẻ kinh nghiệm về website » Tổng hợp code và javascript » Chèn hiệu ứng chữ chạy màu đẹp java cho web
Page 1 of 11
Search: