كدهائي كه ميتوني متن رو به حركت در بياري
نمونه اول يک کد براي جمله هاي انگليسي مي باشد
:
<marquee direction="right">welcome</marquee>
welcome
==================================================
و اما اين کد نيز مخصوص نوشته هاي فارسي ميباشد که ميخواهيد متحرک شوند
<marquee direction="right">welcome</marquee>
==================================================
نمونه
<marquee direction="right" behavior="slide">welcome</marquee>
==================================================
نمونه
:
<marquee direction="right" behavior="alternate">welcome</marquee>
==================================================اين هم يه كد جاوا
متن رو قشنگتر جلوه ميده
کد نمايش پيام به صورت افکت
<!-- START OF Message Reader DHTML -->
<!-- SUMMARY BRIEFS
This DHTML script will cycle through 4 different text links.
You can adjust the text and links below to meet your webpage.
IMPORTANT
Make suer that this body tag is included in your webpage. It
activates the Message Reader.
-->
<body onload="if (document.all||document.layers) {regenerate2();update()}">
<style>
<!--
#msgline{
position:relative;
layer-background-color:black;
width:400;
height:12;
}
#msgtext{
background-color:black;
position:absolute;
border: 1px solid black;
width:400;
height:12;
}
.msgtextfont{
font:bold 16px Arial;
postition:absolute;
left:5px;
text-decoration:none;
color:white;
}
.msgtextfont a{
color:white;
text-decoration:none;
}
-->
</style>
<div id="msgline">
<div id="msgtext" class="msgtextfont">Starting Messages...</div>
</div>
<script language="JavaScript1.2">
var speed=4000
var news=new Array()
news[0]="<a href='http://www.khafankadeh.7p.com'>First line of text....</a>"
news[1]="<a href='http://www.mahmood.7p.com'>Second line of text....</a>"
news[2]="<a href='http://www.andisheh.7p.com'>Third line of text....</a>"
news[3]="<a href='http://www.javakhafan.7p.com'>Add as many as you want....</a>"
i=0
if (document.all)
tickerobject=document.all.msgtext.style
else
tickerobject=document.msgline.document
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",450)
}
function update(){
BgFade(0xff,0xff,0xff, 0x00,0x00,0x00,10);
if (document.layers){
document.msgline.document.msgtext.document.write('<span class="msgtextfont">'+news
+'</span>')
document.msgline.document.msgtext.document.close()
}
else
document.all.msgtext.innerHTML=news
if (i<news.length-1)
i++
else
i=0
setTimeout("update()",speed)
}
function BgFade(red1, grn1, blu1, red2,
grn2, blu2, steps) {
sred = red1; sgrn = grn1; sblu = blu1;
ered = red2; egrn = grn2; eblu = blu2;
inc = steps;
step = 0;
MsgDither();
}
function MsgDither() {
var epct = step/inc;
var spct = 1 - epct;
if (document.layers)
tickerobject.bgColor =
Math.floor(sred * spct + ered *
epct)*256*256 +
Math.floor(sgrn * spct + egrn * epct)*256 +
Math.floor(sblu * spct + eblu * epct);
else
tickerobject.backgroundColor=
Math.floor(sred * spct + ered *
epct)*256*256 +
Math.floor(sgrn * spct + egrn * epct)*256 +
Math.floor(sblu * spct + eblu * epct);
if ( step < inc ) {
setTimeout('MsgDither()',50);
}
step++;
}
</script>
<!-- END OF Message Reader DHTML -->
=======================================
کد نمايش متن ها به طور زيبا
<!-- Start of Fade In and Out JavaScript-->
<!-- Place this entire script into a new webpage and then work off the example. Do not -->
<!-- try to incorporate into an existing webpage, else you may disrupt the Script -->
<!-- Script supplied with CoffeeCup HTML Editor -->
<!-- www.coffeecup.com -->
<HTML>
<HEAD>
<style type="text/css">
<!--
#fadeMe01 { position: absolute; visibility: visible; width: 410px }
#fadeMe02 { position: absolute; visibility: visible; width: 400px }
.content { font: 16pt Verdana, Arial, Helvetica; width: 400px; text-align: center }
.content1 { font: 16pt Verdana, Arial, Helvetica; width: 400px; text-align: center }
.small { font: 6pt Verdana, Arial, Helvetica; width: 400px; text-align: center }
b { font-weight: bold }
a { text-decoration : none }
// -->
</style>
<script type="text/javascript" language="javascript">
<!--
var idme=908601;
var convert = new Array();
var hexbase = new Array("0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "A", "B", "C", "D", "E", "F");
var value=0;
var rgb;
for (x=0; x<16; x++)
for (y=0; y<16; y++) {
convert[value] = hexbase[x] + hexbase[y];
value++;
}
var timerID = null, timerRunning = false;
function stopClock(){
if(timerRunning)
clearTimeout(timerID)
timerRunning = false
}
var layers = document.layers;
var style = document.all;
var both = layers || style;
if (layers) { layerRef = 'document.layers'; styleRef = ''; }
if (style) { layerRef = 'document.all'; styleRef = '.style'; }
function moveLayer(obj, topx, leftx) {
if (both) {
eval(layerRef + '["'+obj+'"]' + styleRef + '.top = topx');
eval(layerRef + '["'+obj+'"]' + styleRef + '.left = leftx');
}
}
var s1, s2, s3, s2r, s2g, s2b, smallest;
function hexToDec(hex) { var value=0; while (true) { if (convert[value] == hex) break; value++; } return value; }
function writeOn(obj, str) {
if (layers) with (document[obj]) {
document.open();
document.write(str);
document.close();
}
if (style) {
eval(obj+'.innerHTML= str');
}
}
function changeColor(obj, str, rgb1, speed, counter) {
if (counter < smallest) {
stopClock();
if (layers) with (document[obj]) { document.open(); document.linkColor = rgb1; document.fgColor = rgb1; document.write(str); document.close(); }
if (style) { eval(obj+'.document.linkColor= rgb1');
eval(obj+'.innerHTML= "<font color="+rgb1+">"+str+"<\/font>"');
// eval(layerRef + '["'+obj+'"]' + styleRef + '.color= rgb1');
}
s2r+=s1; s2g+=s2; s2b+=s3;
tempR = Math.round(s2r); tempG = Math.round(s2g); tempB = Math.round(s2b);
if (tempR <= 0) tempR = 0; if (tempG <= 0) tempG = 0; if (tempB <= 0) tempB = 0;
if (tempR >= 255) tempR = 255; if (tempG >= 255) tempG = 255; if (tempB >= 255) tempB = 255;
rgb1 = convert[tempR] + convert[tempG] + convert[tempB];
counter++;
timerID = setTimeout('changeColor("'+obj+'", "'+str+'", "'+rgb1+'", '+speed+', '+counter+')', speed);
timerRunning = true;
}
}
function fadeText(obj, str, rgb1, rgb2, speed, step) {
var r1, g1, b1, r2, g2, b2;
for (cnt=1; cnt<=2; cnt++) {
eval('r'+cnt+' = hexToDec(rgb'+cnt+'.slice(0,2));');
eval('g'+cnt+' = hexToDec(rgb'+cnt+'.slice(2,4));');
eval('b'+cnt+' = hexToDec(rgb'+cnt+'.slice(4,6));');
}
with (Math) {
s2r = r1; s2g = g1; s2b = b1;
s1 = abs(r1 - r2); s2 = abs(g1 - g2); s3 = abs(b1 - b2);
if (s1 > s2 && s1 > s3) { smallest = s1; } else if (s2 > s1 && s2 > s3) { smallest = s2; } else { smallest = s3; }
s1 = (s1 == 0) ? 0 : s1/smallest; s2 = (s2 == 0) ? 0 : s2/smallest; s3 = (s3 == 0) ? 0 : s3/smallest;
s1*=step; s2*=step; s3*=step;
if (r1 > r2) { s1 = -s1; } if (g1 > g2) { s2 = -s2; } if (b1 > b2) { s3 = -s3; }
smallest= Math.round(smallest/step);
}
if (both) { changeColor(obj, str, rgb1, speed, 0); } else { document.write("Err. for some reason you tried viewing this page with a browser that doesn`t support javascript/CSS block support"); }
}
function getMid() { tvAgent = navigator.userAgent; if (layers) { maxX = innerWidth; maxY = innerHeight; } if (style) { maxX = document.body.clientWidth; maxY = document.body.clientHeight; } if (tvAgent.indexOf("WebTV") != -1) { maxX = 544; maxY = 378; } midX = maxX/2; midY = maxY/2; }
function layout() { getMid(); moveLayer('fadeMe01', midY-50, midX-200);
fadeText("fadeMe01", "<span class=content>NOW PRESENTING</span><div class=small>by popular demand</div>", "000000", "CCCCCC", 10, 2);
setTimeout('fadeText("fadeMe01", "<span class=content>FADE IN AND OUT JavaScript</span><div class=small>A neat JavaScript</div>", "CCCCCC", "000000", 10, 4)',8000);
setTimeout('fadeText("fadeMe01", "<div class=small>A</div><span class=content>It is COOL</span>", "000000", "CCCCFF", 10, 2)',12000);
setTimeout('fadeText("fadeMe01", "<div class=small>A</div><span class=content>Easy to Use</span>", "CCCCFF", "000000", 10, 4)',20000);
setTimeout('moveLayer("fadeMe01", midY-100, midX-200)',24000);
setTimeout('moveLayer("fadeMe02", midY-60, midX-200)',24000);
setTimeout('fadeText("fadeMe01", "<span class=content>This line could be Sentence Line 1.</span>", "000000", "CCCCFF", 10, 4)',26000);
setTimeout('fadeText("fadeMe02", "<span class=content>Sentence Line 2.</span>", "000000", "9999FF", 10, 4)',32000);
setTimeout('fadeText("fadeMe01", "<span class=content>Sentence Line 3.</span>", "CCCCFF", "FF0000", 10, 4)',36000);
setTimeout('fadeText("fadeMe02", "<span class=content>Imagine the envy your friends will feel.</span>", "9999FF", "99FF33", 10, 4)',40000);
setTimeout('fadeText("fadeMe02", "<span class=content>Sentence Line 5.</span>", "99FF33", "CCCCCC", 10, 4)',44000);
setTimeout('fadeText("fadeMe02", "<span class=content>You can now make neat looking text displays.</span>", "CCCCCC", "000000", 10, 4)',48000);
setTimeout('fadeText("fadeMe02", "<span class=small>Sentence Line 7.</div>", "000000", "CCCCCC", 10, 4)',52000);
setTimeout('fadeText("fadeMe01", "<span class=content>-END-</div>", "000000", "FF0000", 10, 4)',57500);
}
// -->
</script>
</HEAD>
<BODY BGCOLOR="#000000" text="#CCCCCC" link="#FFFFFF" vlink="#FFFFFF" onload="layout()">
<div id=fadeMe01></div>
<div id=fadeMe02></div>
<noscript>
Silly! you'll need to have javascript enabled and
you must have <a href="http://www.microsoft.com/">Internet Explorer 4</a> or <a href="http://developer.netscape.com">Netscape Navagitor 4</a>
or <a href="http://developer.webtv.net">WebTV</a>(?) for this script to work.
</noscript>
</BODY>
</HTML>
<!-- End of Fade In and Out JavaScript-->
==================================================
کد روشن شدن متن
<meta http-equiv="Content-Language" content="en-us">
<h2>
<script language="JavaScript1.2">
/*
Neon Lights Text
By JavaScript (http://learniran.com)
Over 500+ free scripts here!
*/
var message="Welcome to my weblog!"
var neonbasecolor="gray"
var neontextcolor="yellow"
var flashspeed=100 //in milliseconds
///No need to edit below this line/////
var n=0
if (document.all){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight">'+message.charAt(m)+'</span>')
document.write('</font>')
//cache reference to neonlight array
var tempref=document.all.neonlight
}
else
document.write(message)
function neon(){
//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color=neonbasecolor
}
//cycle through and change individual letters to neon color
tempref[n].style.color=neontextcolor
if (n<tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}
function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>
</h2>
<p align="center"><font face="Tahoma" size="2">
<a href="http://www.javakhafan.7p.com/">webloger site</a></font></p>
</body>
</html>
=====================================
کد نمايش متن به صورت متحرک
<!-- Start of Self-Scroll TextArea -->
<!-- Scrolls text upwards until all of your message has been displayed. -->
<!-- Instructions:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- Script supplied with CoffeeCup HTML Editor -->
<!-- www.coffeecup.com -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function CC_Scroller(n) {
optlist = document.scrollform.scroller;
optlist[optlist.length] = new Option(optlist[0].text, "", false, false);
optlist[0] = null;
optlist.selectedIndex = -1;
n = (n + 1) % optlist.length;
// change the speed below: 1000 = 1 second.
setTimeout("CC_Scroller("+n+")",2000);
}
// End -->
</script>
</HEAD>
<BODY OnLoad="CC_Scroller(0);">
<center>
<form name="scrollform">
<select name="scroller" size=8>
<option>
<option>
<option>
<option>
<option>
<option>
<option>
<option>
<option>This textarea will auto
<option>scroll text moving it
<option>upwards until all the
<option>lines have been displayed.
<option>
<option>
<option>You can leave as many
<option>blank lines as you feel
<option>necessary to give the
<option>look of begining and
<option>ending.
<option>
<option>Neat, huh?
<option>
</select>
</form>
</center>
<!-- End of Self-Scroll TextArea -->
===================================
کد رقص متن در صفحه
<script language="JavaScript1.2">
//configure message
message="Welcome to javakhafan.7p.com"
//animate text in NS6? (0 will turn it off)
ns6switch=1
var ns6=document.getElementById&&!document.all
mes=new Array();
mes[0]=-1;
mes[1]=-4;
mes[2]=-7;mes[3]=-10;
mes[4]=-7;
mes[5]=-4;
mes[6]=-1;
num=0;
num2=0;
txt="";
function jump0(){
if (ns6&&!ns6switch){
jump.innerHTML=message
return
}
if(message.length > 6){
for(i=0; i != message.length;i++){
txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
jump.innerHTML=txt;
txt="";
jump1a()
}
else{
alert("Your message is to short")
}
}
function jump1a(){
nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
nfinal.style.left=-num2;
if(num2 != 9){
num2=num2+3;
setTimeout("jump1a()",50)
}
else{
jump1b()
}
}
function jump1b(){
nfinal.style.left=-num2;
if(num2 != 0){num2=num2-3;
setTimeout("jump1b()",50)
}
else{
jump2()
}
}
function jump2(){
txt="";
for(i=0;i != message.length;i++){
if(i+num > -1 && i+num < 7){
txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
}
else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
}
jump.innerHTML=txt;
txt="";
if(num != (-message.length)){
num--;
setTimeout("jump2()",50)}
else{num=0;
setTimeout("jump0()",50)}}
</script>
</head>
<body>
<h2><div id="jumpx" style="color:green"></div></h2>
<script>
if (document.all||document.getElementById){
jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx
jump0()
}
else
document.write(message)
</script>
Top Java Script in <font face="Tahoma" size="2"> <a href=http://www.javakhafan.7p.com>کدهاي جاوا اسکريپت</a>
</font>
============================================
==================================================
کد افکت شماره ي يک
<HTML><HEAD>
<meta http-equiv="Content-Language" content="en-us">
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY>
<DIV id=Zittertext
style="FONT-WEIGHT: bold; FONT-SIZE: 25pt; FILTER: Wave(freq=5, light=0, phase=8, strength=1); WIDTH: 100%; COLOR: orange">
<p align="center"><font color="#000000">
<span style="background-color: #FFFF00">www.javakhafan.9f.com</span></font></DIV>
<SCRIPT language=JavaScript>
<!--
function DynWave()
{
if(document.all.Zittertext.filters[0].freq > 130)
document.all.Zittertext.filters[0].freq = 15;
document.all.Zittertext.filters[0].freq += 1;
if(document.all.Zittertext.filters[0].phase > 50)
document.all.Zittertext.filters[0].phase = 1;
document.all.Zittertext.filters[0].phase += 1;
if(document.all.Zittertext.filters[0].strength > 1)
document.all.Zittertext.filters[0].strength = .1;
document.all.Zittertext.filters[0].strength += 1;
window.setTimeout("DynWave()",100);
}
DynWave();
// -->
</SCRIPT>
</BODY></HTML>
==================================================
کد افکت شماره ي دو
<HTML><HEAD>
<meta http-equiv="Content-Language" content="en-us">
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY><SPAN id=pochenderText style="WIDTH: 100%">
<H1 align="center"><font color="#FF0000">www.javakhafan.9f.com</font></H1></SPAN>
<SCRIPT>
<!--
// (C) 2002 Christian Heidler [ All rights reserved ].
// e-mail: [email protected]
var from = 4; // minimalgr??e(pochen)
var to = 12; // maximalgr??e(pochen)
var speed = 1; // Geschwindigkeit (je kleiner der Wert, umso schneller pocht es)
var textcolor = "#aabbdd"; // Farbe ausw?hlen (hexadezimalen code od. Html-Farbname)
var i = to;
var j = 0;
pd();
function pu()
{
if (!document.all)
return
if (i < to)
{
pochenderText.style.filter = "Glow(Color=" + textcolor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('pu()',speed);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('pd()',speed);
return 0;
}
}
function pd()
{
if (!document.all)
return
if (i > from)
{
pochenderText.style.filter = "Glow(Color=" + textcolor + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('pd()',speed);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('pu()',speed);
return 0;
}
}
// -->
</SCRIPT>
</BODY></HTML>
==================================================