PersianTools Forums

Go Back   PersianTools Forums > برنامه نویسی و طراحی وب، سیستمهای مدیریت سایت > توسعه وب > HTML

Reply
 
امکانات بيشتر
Old 04-02-2004, 02:46 AM   #1
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
Icon14 كد هاي زيبا براي سايت و وبلاگ شما

پنهان کردن اسکريپتهاي جاوا از دست مرورگرهاي قديمي


Code:
 <html> 
<head>
</head>
 
<body>
 
<h1>
 
<!-- hide script from old browsers -->
 
<script language="javascript" type="text/javascript">
 
document.write("IranJavaScript")
 
//end hiding script from old browsers -->
</script>
</h1>
 
</body>
</html>
rufozeh is offline   Reply With Quote
Old 04-02-2004, 02:49 AM   #2
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
تغيير رنگ پس زمينه هنگام ورود به صفحه

Code:
 <script> 
// Modified by CoffeeCup Software
 
function initArray() 
{
this.length = initArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i]
}
 
var hexChars = "0123456789ABCDEF";
 
function Dec2Hex (Dec) 
{
var a = Dec % 16;
var b = (Dec - a)/16;
hex = "" + hexChars.charAt(b) + hexChars.charAt(a);
return hex;
}
 
function bgChanger (begin, end, steps) 
{
steps = steps -1 ;
 
redA = begin.charAt(0) + begin.charAt(1);
red_valA = parseInt(redA,'16');
redB = end.charAt(0) + end.charAt(1);
red_valB = parseInt(redB,'16');
red_int = ((red_valB - red_valA) / steps) * -1;
grnA = begin.charAt(2) + begin.charAt(3);
grn_valA = parseInt(grnA,'16');
grnB = end.charAt(2) + end.charAt(3);
grn_valB = parseInt(grnB,'16');
grn_int = ((grn_valB - grn_valA) / steps) * -1;
bluA = begin.charAt(4) + begin.charAt(5);
blu_valA = parseInt(bluA,'16');
bluB = end.charAt(4) + end.charAt(5);
blu_valB = parseInt(bluB,'16');
blu_int = ((blu_valB - blu_valA) / steps) * -1;
 
step = 2;
red = red_valA;
grn = grn_valA;
blu = blu_valA;
 
document.bgColor = begin;
 
while ( steps >= step ) 
{
red -= red_int;
red_round = Math.round(red);
red_hex = Dec2Hex(red);
 
grn -= grn_int;
grn_round = Math.round(grn);
grn_hex = Dec2Hex(grn);
 
blu -= blu_int;
blu_round = Math.round(blu);
blu_hex = Dec2Hex(blu);
 
document.bgColor = red_hex + grn_hex + blu_hex;
 
step++;
}
document.bgColor = end;
}
 
</script>
</head>
<body bgcolor=#000000 text=#FFFFFF link="FF0000" vlink="8888FF" 
 
alink="FF00FF">
<script>
<!-- 
// black to black (pause)
bgChanger("000000","000000",25);
// black to red
bgChanger("000000","FF0000",25);
// red to black
bgChanger("FF0000","000000",25);
// black to purple 
bgChanger("000000","AA00EE",25);
// purple to black
bgChanger("AA00EE","000000",25);
// black to blue
bgChanger("000000","0000FF",25);
// blue to black
bgChanger("0000FF","000000",25);
// black to black (pause)
bgChanger("000000","000000",25);
// -->
</script>
</head>
<body>
<BODY BGCOLOR=000000 text="#ffffff" link="#0000ff" 
 
vlink="#c00c0">
 
 
_____________________________________________________
تنظيم يک فيلد بر اساس فيلد ديگر
 
<html>
<head>
<script language="javascript" type="text/javascript">
function SubmitIt(carForm) {
doorOption = -1
 
if (carForm.DoorCt[doorOption].value == "fourDoor" && carForm.sunroof.checked) {
alert("The sunroof is only available on the two door model")
return false
}
return true
}
 
function doorSet(sunroofField) {
	if (sunroofField.checked) {
		for (i=0; i<document.myForm.DoorCt.length; i++) {
			if (document.myForm.DoorCt[i].value == "twoDoor") {
				document.myForm.DoorCt[i].checked = true
				}
			}
		}
	}
</script>
</head>
<body>
<h2>
Car Picker<p>
<form onSubmit="return SubmitIt(this)" action="ok.asp" name="myForm">
Doors:
<br>
<input type="CHECKBOX" name="sunroof" value="YES" onClick="doorSet(this)">Sunroof(two door only)
<br><br>
<input type="radio" value="twoDoor" name="DoorCt">two 
<input type="radio" value="fourDoor" name="DoorCt">Four
<br>
 
<input type="Submit" value="Submit">
</form></h2>
</body>
</html>
rufozeh is offline   Reply With Quote
Old 04-02-2004, 05:15 PM   #3
Trusted Member
Mashaheer
مدیر بازنشسته
 
Mashaheer's Avatar
 

Join Date: May 2003
Location: UAE
Posts: 1,990
Send a message via Yahoo to Mashaheer
دستتون درد نكنه دوست عزيز
بهتر اين كدها رو بين دو تگ كد (code) قرار بدهيد.
موفق باشيد.
Mashaheer is offline   Reply With Quote
Old 04-03-2004, 10:34 AM   #4
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
طريقه ايجاد افكت Glow براي متن نوشته شده :

Code:
<p><font face="Tahoma">
<span style="FILTER: glow(Color=#50710,Strength=2); WIDTH: 1px; HEIGHT: 1px">
<font face="Tahoma" color="#ffff00" style="font-size:15pt">welcome</font></span></font></p>

Last edited by rufozeh; 04-03-2004 at 12:14 PM..
rufozeh is offline   Reply With Quote
Old 04-03-2004, 11:10 AM   #5
Trusted Member
Mashaheer
مدیر بازنشسته
 
Mashaheer's Avatar
 

Join Date: May 2003
Location: UAE
Posts: 1,990
Send a message via Yahoo to Mashaheer
سلام دوست عزيز
من اين كدها رو امتحان نكردم ولي سوالي دارم:
1. آيا اين كدها رو از جايي كپي مي كنيد؟
2. نقش كدهاي استايل در اين مثال چيه؟
3. پايين تگي بسته نشده

موفق باشيد.
Mashaheer is offline   Reply With Quote
Old 04-03-2004, 12:07 PM   #6
Administrator
ehsan
Administrator
 
ehsan's Avatar
 

Join Date: Dec 2002
Location: Internet
Posts: 7,811
رفوزه جان ممنون. فقط دو نکته. یکی اینکه اگه بتونی اینا رو به عنوان تست روی یه سری صفحه نمایش بدی. دیگه اینکه کدها رو توی تگ کد بذاری. من دو تای قبلی رو اصلاح کردم.
ممنون و موفق باشی
__________________
سعی می کنم جواب بدم: احسان at پرشین تولز dot کام
میزبانی| ثبت دومین | سرور اختصاصی | طراحی وب | هاستینگ
ehsan is offline   Reply With Quote
Old 04-03-2004, 04:18 PM   #7
Trusted Member
Mashaheer
مدیر بازنشسته
 
Mashaheer's Avatar
 

Join Date: May 2003
Location: UAE
Posts: 1,990
Send a message via Yahoo to Mashaheer
دستت درد نكنه احسان جان كه كدها رو تصحيح كردي
Mashaheer is offline   Reply With Quote
Old 04-04-2004, 06:04 AM   #8
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
كد براي قرار دادن فايل هل ( لوگو ... بنر و.... ) فلش در وبلاگ يا سايت :

Code:
<<embed width="128" height="128" src="url.swf"></p>
</body>
</html>
در قسمت url.swf آدرس مورد نظر خود را تايپ كنيد.
rufozeh is offline   Reply With Quote
Old 04-04-2004, 12:14 PM   #9
Trusted Member
Mashaheer
مدیر بازنشسته
 
Mashaheer's Avatar
 

Join Date: May 2003
Location: UAE
Posts: 1,990
Send a message via Yahoo to Mashaheer
Quote:
نوشته ای از rufozeh
كد براي قرار دادن فايل هل ( لوگو ... بنر و.... ) فلش در وبلاگ يا سايت :

Code:
<<embed width="128" height="128" src="url.swf"></p>
</body>
</html>
در قسمت url.swf آدرس مورد نظر خود را تايپ كنيد.
دوست عزيز اين كد به صورت زير هستش:
Code:
<embed src="FILE" height="SIZE" width="SIZE">
اين تگ خارجي هستش كه مي توانيد به جاي گزينه فايل، فايلهاي با فرمتها مختلف صوتي، تصويري قرار بدهيد.

موفق باشيد.
Mashaheer is offline   Reply With Quote
Old 04-05-2004, 03:24 AM   #10
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
متن سايه دار:
Code:
<html>

<head>
<title>New Page 1</title>
<script type = "TEXT/JAVASCRIPT" LANGUAGE = "JAVASCRIPT">
	function doShadow(newDiretction){
		if (document.all && newDiretction < 360) {
			newDiretction += 10 
			document.all.dropText.style.filter="shadow(direction=" + 

newDiretction + ")"
			setTimeout("doShadow(" + newDiretction + ")" , 100)
			}
		}
</script>

<STYLE TYPE="TEXT/CSS">
	#dropText {width: 500px; height: 100px; font-size: 36px; filter: 

shadow(direction=90)}
</STYLE>
</head>
<body>
<DIV ID="dropText">
به وبلاگ من خوش آمديد
</DIV>

</body>

</html>
rufozeh is offline   Reply With Quote
Old 04-05-2004, 05:18 AM   #11
Trusted Member
Mashaheer
مدیر بازنشسته
 
Mashaheer's Avatar
 

Join Date: May 2003
Location: UAE
Posts: 1,990
Send a message via Yahoo to Mashaheer
خيلي جالب بود رفوزه جان
براي اين كار مي توان از حالت فيلترها در استايل هم استفاده كرد.
موفق باشيد.
Mashaheer is offline   Reply With Quote
Old 04-06-2004, 02:34 AM   #12
Trusted Member
aaber_piade
کاربر فعال مووبل تایپ
 
aaber_piade's Avatar
 

Join Date: Dec 2002
Location: Tehran
Posts: 1,732
Send a message via Yahoo to aaber_piade
اينا کارايي جالبي هست .. البته متاسفانه پشتيباني فيلتر ها به ie محدود ميشه..
__________________
Providing Linux various services
aaber_piade is offline   Reply With Quote
Old 04-06-2004, 06:16 AM   #13
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
انتخاب رنگ پس زمينه:

Code:
<body>
<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Amir - http://www.IranJavaScript.com

function backbs(clr) {
document.bgColor = clr
}
<!--Template Name:"Asre Jadid"-By:Amin Asemi E.For Persianblog's blog--> 
//-->
</script>
<form>
<input type="button" value="zard" onclick="backbs('yellow')"> 
<input type="button" value="khaki" onclick="backbs('khaki')"> 
<input type="button" value="sefid" onclick="backbs('white')"> 
<input type="button" value="toosi" onclick="backbs('gray')">
<input type="button" value="meshki" onclick="backbs('black')">
<input type="button" value="soorati" onclick="backbs('pink')">
<input type="button" value="abi" onclick="backbs('blue')">
<input type="button" value="sabz" onclick="backbs('Green')">
<input type="button" value="noghre ei" onclick="backbs('silver')">
<input type="button" value="sabz tire" onclick="backbs('teal')">
<input type="button" value="limooei" onclick="backbs('lime')">
<input type="button" value="abi nafti" onclick="backbs('navy')">
<input type="button" value="ghermez" onclick="backbs('red')">
<input type="button" value="narenji" onclick="backbs('orange')">
<input type="button" value="ghahve ei" onclick="backbs('olive')">
<input type="button" value="banafsh" onclick="backbs('purple')">
</form>
</script>
</body>
rufozeh is offline   Reply With Quote
Old 04-07-2004, 03:10 AM   #14
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
با انجام عمل Double Click عمل خاصي را مشاهده خواهيد كرد
براي عمل onDbclick Event

onDblclick="newWindow(1)"

بدين صورت با دوبار کليک بر روي تصوير کوچک, تصوير بزرگ آن در پنجره جديد نمايش داده ميشود.

Code:
<html> 
<head> 
<script language="javascript" type="text/javascript"> 
function newWindow(imgNumber) { 
imgName = "images/test" + imgNumber + ".gif" 
imgWindow = window.open(imgName,"imgWin","width=320,height=240,scrollbars=no") 
} 
</script> 
</head> 
<body> 
<h2>Double-click on an image to see the full-size version</h2> 
<img src="images/test1.gif" border="2" onDblclick="newWindow(1)"> 
<img src="images/test2.gif" border="2" onDblclick="newWindow(2)"> 
<img src="images/test3.gif" border="2" onDblclick="newWindow(3)"> 

</body> 
</html>
rufozeh is offline   Reply With Quote
Old 04-07-2004, 10:18 AM   #15
rufozeh
Registered User
 
rufozeh's Avatar
 

Join Date: Mar 2004
Posts: 78
پيام هنگام ورود به صفحه:
Code:
<html>
<head>
<script language="javascript" type="text/javascript">

alert("Welcome to my weblog")

</script>

</head>

<body>
<h1>

<!-- hide script from old browsers -->
<!--this is on example of a long JavaScript comment-->

<script language="javascript" type="text/javascript">

document.write("IranJavaScript")

//end hiding script from old browsers -->
</script>
</h1>

</body>
</html>
rufozeh is offline   Reply With Quote
Reply

امکانات بيشتر

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +4.5. The time now is 07:27 PM.

PersianTools RSS Feeds


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.