PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : آموزشی آموزش كد نويسي با Java-Script



Asghar2000
13th April 2010, 01:09 PM
بنام يگانه ي هستي بخش

يكي از ابزارهاي قدرتمند در طرح و ايجاد صفحات زيباي وب Java Script مي باشد . همگان مي دانيم كه استفاده از HTML بدون ابزارهاي قدرتمند ديگر در دنياي امروزي عملا مطرود گرديده است . حالا با توجه به اين مهم بر آن شديم تا بدون پرداختن به جزئيات برنامه نويسي Java Script تعدادي از اين كدها را با ذكر عملي كه انجام مي دهند گردآوري كنيم كه اميدواريم مورد استفاده كاربران محترم قرار گيرد . ضمنا منتظر ارائه نظرات و پيشنهادات شما از طريق آدرس الكترونيكي vlearning@etvto.ir (vlearning@etvto.ir)هستيم .

Asghar2000
13th April 2010, 01:10 PM
موضوع اسكريپت كنترل بر رمز ورودي



اين اسكريپت زماني كاربرد دارد كه شما يك Max Length براي فيلد ورودي Password تعريف كنيد در اينصورت اگر تعداد كاراكترهاي وارد شده از حداقل آن عددد تعريف شده كمتر باشد پيام خطا ظاهر مي شود ضمنا اگر كاراكترهاي دو ميدان ورودي Password و تاييد آن با هم ناهمخوان باشند پيام خطا ظاهر مي شوند .



<!-- TWO STEPS TO INSTALL VALIDATION (PASSWORD):
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.ostadonline.com -->
<!-- Begin
function validatePwd() {
var invalid = " "; // Invalid character is a space
var minLength = 6; // Minimum length
var pw1 = document.myForm.password.value;
var pw2 = document.myForm.password2.value;
// check for a value in both fields.
if (pw1 == '' || pw2 == '') {
alert('Please enter your password twice.');
return false;
}
// check for minimum length
if (document.myForm.password.value.length < minLength) {
alert('Your password must be at least ' + minLength + ' characters long. Try again.');
return false;
}
// check for spaces
if (document.myForm.password.value.indexOf(invalid) > -1) {
alert("Sorry, spaces are not allowed.");
return false;
}
else {
if (pw1 != pw2) {
alert ("You did not enter the same new password twice. Please re-enter your password.");
return false;
}
else {
alert('Nice job.');
return true;
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=myForm onSubmit="return validatePwd()">
Enter your password twice.
<br>
(At least 6 characters, 12 characters max, and spaces are not allowed.)
<p>
Password: <input type=password name=password maxlength=12>
<br>
Verify password: <input type=password name=password2 maxlength=12>
<p>
<input type=submit value="Submit">
</form>
</center>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided by ostadonline<br>
</center><p>
<!-- Script Size: 1.98 KB -->

http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=2#open)

Asghar2000
13th April 2010, 01:11 PM
موضوع اسكريپت موافقت قبل از ورود اطلاعات



اين اسكريپت در زماني كاربرد دارد كه دو كليد راديويي مربوط به موافقت و يا عدم موافقت داشته باشيد . در اينصورت اگر شما كليد موافقت را اعلام كنيد در Box مربوطه مي توانيد اسم خود را وارد و يا تغيير دهيد در غير اينصورت Box قفل شده و شما حق نوشتن و يا تغييرات را در آن نداريد . اين مورد بيشتر براي مواقعي كاربرد دارد كه مسئول سايت تعهدي در قبال ضرري كه بازديد كننده از خريد نرم افزار يا هر چيز ديگري متضمن مي شود را ندارد .




<!-- TWO STEPS TO INSTALL AGREE BEFORE ENTRY:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.ostadonline.com-->
<!-- Begin
agree = 0; // 0 means 'no', 1 means 'yes'
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=enableform>
You can only enter your name if you agree to the terms. (just a demo)<br>
<br>
<input type=radio name='enable' value='agree' onClick="agree=1; document.enableform.box.focus();">I agree<br>
<input type=radio name='enable' value='disagree' onClick="agree=0; document.enableform.box.value='';">I disagree<br>
Please enter your name:
<input type=text name=box onFocus="if (!agree)this.blur();" onChange="if (!agree)this.value='';" size=12>
<br>
<br>
<input type=submit value="Done!">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline<br>
by
<!-- Script Size: 1.12 KB -->


<A onclick="window.open('img/java-aks/agree.html','','width=520,height=430');" href="http://www.ostadonline.com/courses.asp?a=27&p=6#open">http://www.ostadonline.com/img/java-aks/coding.gif

Asghar2000
13th April 2010, 01:12 PM
موضوع اسكريپت All Lower Case



اين اسكريپت تبديل كننده تمام ورودي يك فيلد متني به حروف كوچك مي باشد .



<!-- ONE STEP TO INSTALL ALL LOWER CASE:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://WWW.OSTADONLINE.COM-->
<center>
<form name="capsform">
<input type="text" name="caps" size=40 value="" onChange="javascript:this.value=this.value.toLowerCase();">
<br>
<input type="button" value="Ok!">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline<br>

<!-- Script Size: 0.55 KB -->

http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=18#open)

Asghar2000
13th April 2010, 01:13 PM
موضوع اسكريپت تصديق و تاييد



اين كد كاربران را به درست بودن قالبي كه وارد كردند اطمينان مي دهد مثلا در مورد Zip code عدد وارد شده بايد پنج رقمي باشد .




<!-- TWO STEPS TO INSTALL ZIP CODE VALIDATION:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Brian Swalwell -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.ostadonline.com -->
<!-- Begin
function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;
if (field.length!=5 && field.length!=10) {
alert("Please enter your 5 digit or 5 digit+4 zip code.");
return false;
}
for (var i=0; i < field.length; i++) {
temp = "" + field.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your zip code. Please try again.");
return false;
}
if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {
alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'. Please try again.");
return false;
}
}
return true;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=zip onSubmit="return validateZIP(this.zip.value)">
Zip: <input type=text size=30 name=zip>
<input type=submit value="Submit">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline<br>
</center><p>
<!-- Script Size: 1.39 KB -->

http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=36#open)

Asghar2000
13th April 2010, 01:14 PM
موضوع اسكريپت قبول شرايط و ضوابط



اين اسكريپت به كاربران و بازديد كنندگان سايت شما اجازه مي دهد كه قبل از پردازش يك فرم توسط سايت ضوابط و شرايط شما را قبول يا رد كنند كه در صورت عدم قبول به صفحه Home Page باز خواهد گشت .



<!-- TWO STEPS TO INSTALL ACCEPT TERMS:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Colin Pc -->
<!-- Web Site: http://www.insighteye.com/ -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please check the box to continue.');
return false;
}else
return true;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form action="/yourscript.cgi-or-your-page.html" method="POST" onsubmit="return checkCheckBox(this)">
I accept: <input type="checkbox" value="0" name="agree">
<input type="submit" value="Continue Order">
<input type="button" value="Exit" onclick="document.location.href='/index.html';">
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided by ostadonline<br>
<!-- Script Size: 1.21 KB -->




<A onclick="window.open('img/java-aks/accept.html','','width=600,height=430');" href="http://www.ostadonline.com/courses.asp?a=27&p=37#open">http://www.ostadonline.com/img/java-aks/coding.gif

Asghar2000
13th April 2010, 01:15 PM
موضوع اسكريپت All Upper Case



اين اسكريپت تبديل كننده تمام ورودي يك فيلد متني به حروف كوچك مي باشد .



<!-- ONE STEP TO INSTALL ALL LOWER CASE:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<center>
<form name="capsform">
<input type="text" name="caps" size=40 value="" onChange="javascript:this.value=this.value.toLowerCase();">
<br>
<input type="button" value="Ok!">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline<br>
</center><p>
<!-- Script Size: 0.55 KB -->



<A onclick="window.open('img/java-aks/uppercase.html','','width=600,height=430');" href="http://www.ostadonline.com/courses.asp?a=27&p=38#open">http://www.ostadonline.com/img/java-aks/coding.gif

Asghar2000
13th April 2010, 01:16 PM
موضوع اسكريپت منوي متن



بوسيله اين اسكريپت كاربر مي تواند با رد كردن موس از روي كليدهاي ايجاد شده متن خاصي در ميدان متني براي آن يه نمايش در آيد . اين متن ها را مي توان در داخل اسكريپت گنجاند .


<!-- TWO STEPS TO INSTALL MENU TEXT:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Menu1(form) {
form.TXTVal.value="This script uses buttons to view the text";
}
function Menu2(form) {
form.TXTVal.value="Text appears when you put your mouse over the buttons";
}
function Menu3(form) {
form.TXTVal.value="The buttons can even link to a message. Click this one!";
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<div align="center">
<form>
<br><input type="button" value="Menu1" onmouseover="Menu1(this.form);"><input type="button" value="Menu2" onmouseover="Menu2(this.form);"><input type="button" value="Menu3" onmouseover="Menu3(this.form);" onclick="javascript:alert('This is could link to another page.')">
<br><input type="text" name="TXTVal" size="60">
</form>
</div>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.47 KB -->


http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=39#open)

Asghar2000
13th April 2010, 01:17 PM
موضوع اسكريپت منوي فايلهاي Midi



اين اسكريپت به كاربر اجازه مي دهد كه آهنگ دلخواه خود را از منو انتخاب و هنگاميكه ارتباط با سايت برقرار است به عنوان موزيك Background به اجرا در مي آيد .


<!-- TWO STEPS TO INSTALL MIDI MENU:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
songNum = new Array();
songNum[0] = "#";
songNum[1] = "http://www.ostadonline.com/ws/janmaryam.mid";
songNum[2] = "http://www.ostadonline.com/ws/ayiran.mid";
songNum[3] = "http://www.ostadonline.com/ws/azkarkhe.mid";
songNum[4] = "http://www.ostadonline.com/ws/m-mjan.mid";
var music = null;
var track = 0;
var ver = navigator.appName;
function audioCheck(plugName) {
for (var i = 0; i < navigator.plugins.length; i++) {
if (navigator.plugins[i].name.toLowerCase() == plugName.toLowerCase()) {
for (var j = 0; j < navigator.plugins[i].length; j++) {
if (navigator.plugins[i][j].enabledPlugin) {
return true;
}
}
return false;
}
}
return false;
}
function chooseSong(s) { // ie
track = s.options[s.selectedIndex].value;
if (ver == "Microsoft Internet Explorer") {
document.all.music.src = songNum[track];
} else {
songPlay('play');
}
}
function songPlay(cmd) { // netscape
if (audioCheck("LiveAudio")) {
if (cmd == 'play') {
document.musicSource.play(false, songNum[track]);
}
} else {
alert("You Do Not Have The Correct Plugin");
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=choose>
<select size=1 name=track onChange="chooseSong(this);">
<option value="0">music1</option>
<option value="1">music2</option>
<option value="2">music3</option>
<option value="3">music4</option>
<option value="4">music5</option>
</select>
<input type=button onMouseDown="chooseSong(document.choose.track)" value=" Play ">
</form>
<script language="JavaScript">
<!-- Begin
var ver = navigator.appName;
if (ver == "Microsoft Internet Explorer") {
document.write('<bgsound src="#" ID=music loop=1 AUTOSTART=true>');
} else {
document.write('<embed type="audio/midi" src="janmaryan.mid" AUTOSTART=false hidden=true VOLUME="90" name="musicSource" MASTERSOUND></EMBED>');
}
// End -->
</script>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 2.53 KB -->


http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=40#open)

Asghar2000
13th April 2010, 01:19 PM
موضوع اسكريپت جابه جايي پنجره



اين اسكريپت همراه با كليدهايي كه ايجاد مي شود باعث جابجايي پنجره مرورگر براي كاربر خواهد شد بدين صورت كه كافي است كاربر بر روي كليدهايي كه ايجاد شده كليك كند تا پنجره را به سمت دلخواه حركت دهد .


<!-- TWO STEPS TO INSTALL MOVE WINDOW:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function moveWindowLeft() {
window.moveBy(-15, 0);
window.moveBy(0, 0);
}
function moveWindowRight() {
window.moveBy(15, 0);
window.moveBy(0, 0);
}
function moveWindowUp() {
window.moveBy(0, 0);
window.moveBy(0, -15);
}
function moveWindowDown() {
window.moveBy(0, 0);
window.moveBy(0, 15);
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form>
<table>
<tr>
<td>
</td>
<td>
<input type=button value=" ^ " onClick="moveWindowUp();">
</td>
<td>
</td>
</tr>
<tr>
<td>
<input type=button value=" < " onClick="moveWindowLeft();">
</td>
<td>
</td>
<td>
<input type=button value=" > " onClick="moveWindowRight();">
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type=button value=" v " onClick="moveWindowDown();">
</td>
<td>
</td>
</tr>
</table>
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.41 KB -->



<A onclick="window.open('img/java-aks/movewindow.html','','width=600,height=430');" href="http://www.ostadonline.com/courses.asp?a=27&p=41#open">http://www.ostadonline.com/img/java-aks/coding.gif

Asghar2000
13th April 2010, 01:20 PM
موضوع اسكريپت چك كردن IP Address



بوسيله اين اسكريپت كاربر مي تواند چك كند كه عدد وارد شده در ميدان متني IP مي باشد يا خير .


<!-- TWO STEPS TO INSTALL VALIDATION (IP ADDRESS):
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function verifyIP (IPvalue) {
errorString = "";
theName = "IPaddress";
var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
var ipArray = IPvalue.match(ipPattern);
if (IPvalue == "0.0.0.0")
errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
else if (IPvalue == "255.255.255.255")
errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
if (ipArray == null)
errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
else {
for (i = 0; i < 4; i++) {
thisSegment = ipArray[i];
if (thisSegment > 255) {
errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
i = 4;
}
if ((i == 0) && (thisSegment > 255)) {
errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
i = 4;
}
}
}
extensionLength = 3;
if (errorString == "")
alert ("That is a valid IP address.");
else
alert (errorString);
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form>
IP Address:
<input size=15 name="IPvalue">
<input type="submit" value="Verify" onClick="verifyIP(IPvalue.value)";>
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.91 KB -->


http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=54#open)

Asghar2000
13th April 2010, 01:21 PM
موضوع اسكريپت Email به هر جا



اين اسكريپت به كاربران اجازه مي دهد كه در هر زمان به هر آدرسي Email ارسال كنند .


<!-- TWO STEPS TO INSTALL ANYWHERE MAIL:
1. Paste the designated coding into the HEAD of your HTML document
2. Put the last script into the BODY of the HTML document -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.ostadonline.com -->
<!-- Begin
function mailsome1(){
who=prompt("Enter recipient's email address: ","vlearning@etvto.ir");
what=prompt("Enter the subject: ","none");
if (confirm("Are you sure you want to mail "+who+" with the subject of "+what+"?")==true){
parent.location.href='mailto:'+who+'?subject='+wha t+'';
}
}
// End -->
</SCRIPT>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<CENTER>
<a href='javascript:mailsome1()'>E-Mail Someone!</a>
<FORM>
<input type=button value="E-Mail Someone!" onClick="mailsome1()">
</FORM>
</CENTER>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline<br>

<!-- Script Size: 1.02 KB -->


http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=10#open)

Asghar2000
13th April 2010, 01:22 PM
موضوع اسكريپت عوض كننده رنگ Background



با اين اسكريپت كاربران مي توانند با كليك بر روي كليدهايي كه قبلا در صفحه ايجاد شده رنگ پيش زمينه صفحه را به دلخواه تغيير دهند .



<!-- TWO STEPS TO INSTALL BACKGROUND COLOR CHANGER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com (http://njavan.com/forum/redirector.php?url=http%3A%2F%2Fjavascript.interne t.com) -->

<!-- Begin
function newbg(thecolor)
{
document.bgColor=thecolor;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<div align="center">
<form>
<input type="button" value="White" onclick="newbg('white');">
<input type="button" value="Blue" onclick="newbg('blue');">
<input type="button" value="Beige" onclick="newbg('Beige');">
<input type="button" value="Yellow" onclick="newbg('yellow');">
</form>
</div>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided by ostadonline<br>

<!-- Script Size: 1.12 KB -->

Asghar2000
13th April 2010, 01:24 PM
موضوع اسكريپت عوض شدن رنگ پيش زمينه با mouseover



از اين اسكريپت براي عوض كردن رنگ پيش زمينه صفحه وب استفاده مي شود كه اين امر يا با رد كردن موس از روي يك ابر متن و يا با كليلك بر روي ابر متن انجام مي پذيرد .


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- TWO STEPS TO INSTALL BACKGROUND COLOR-CHANGE:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document --><!-- STEP ONE: Paste this code into the HEAD of your HTML document --><HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
<SCRIPT language=JavaScript>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.ostadonline.com -->
<!-- Begin
// Copyright 2001 by www.CodeBelly.com (http://www.CodeBelly.com)
// Please do *not* remove this notice.
var backColor = new Array(); // don't change this
// Enter the colors you wish to use. Follow the
// pattern to use more colors. The number in the
// brackets [] is the number you will use in the
// function call to pick each color.
backColor[0] = '#FF0000';
backColor[1] = '#00FF00';
backColor[2] = '#FFC0C0';
backColor[3] = '#FFFFFF';
// Do not edit below this line.
function changeBG(whichColor){
document.bgColor = backColor[whichColor];
}
// End -->
</SCRIPT>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<META content="MSHTML 6.00.2726.2500" name=GENERATOR></HEAD>
<BODY><!--
Example One -- changing bg color with mouseOver.
Set the number in the () in the changeBG() function
to the number of the color in the brackets in the
backColor[] array to select a given color.
//--><A onmouseover=javascript:changeBG(2)
href="file:///C:/Documents%20and%20Settings/B.Zarabian/Desktop/g.html#">Change
by placing mouse over link</A> <!--
Example Two -- changing bg color with a mouse click.
Set the number in the () in the changeBG() function
to the number of the color in the brackets in the
backColor[] array to select a given color.
//--><A href="javascript:changeBG(1)">Change by clicking on link</A>
<P>
<CENTER><FONT face="arial, helvetica" size?-2?>Free JavaScripts provided by
ostadonline<BR><!-- Script Size: 1.79 KB --></FONT></CENTER></BODY></HTML>


http://www.ostadonline.com/img/java-aks/coding.gif (http://www.ostadonline.com/courses.asp?a=27&p=12#open)

Asghar2000
13th April 2010, 01:24 PM
موضوع اسكريپت كليدي براي پخش يا عدم پخش موزيك در صفحه وب



با اين اسكريپت مي توانيد موزيكي كه در پيش زمينه صفحه در حال پخش مي باشد را اجرا و يا حتي قفل كنيد .



<!-- ONE STEP TO INSTALL BACKGROUND MUSIC SWITCH:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<!-- This script and many more are available free online at -->

<script>
function mus1()
{
if (t.options.selectedIndex==0){
mus.innerHTML="<embed src="+musi+" loop=-1>"
}
if (t.options.selectedIndex==1){
mus.innerHTML=""
}
}
document.write("<span id='mus' style='position:absolute;top:-90000'><embed src="+musi+" width=0 height=0 loop=-1></span>")
</script>
<select name="t" onchange=mus1()>
<option>Enable background music
<option>Disable background music
</select>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 1.29 KB -->

Asghar2000
13th April 2010, 01:26 PM
موضوع اسكريپت نمايش صفحه بصورت اسلايد



اين اسكريپت صفحه نمايش را از بالا و پايين و چپ و راست صفحه نمايش به حركت در مي آورد .


<!-- ONE STEP TO INSTALL BACKGROUND SLIDE:
1. Copy the coding into the HEAD of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
for (t = 2; t > 0; t--) {
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(0,-x);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(0,x);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(x,0);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(-x,0);
}
}
}
//-->
// End -->
</script>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided by ostadonline<br>

<!-- Script Size: 1.00 KB -->

Asghar2000
13th April 2010, 01:27 PM
موضوع اسكريپت Up Load



اين اسكريپت به كاربران اجازه مي دهد كه فايلهايي از نوع gif و jpg و ديگر فايلهايي كه تعريف شده است را از ميان يك فرم Upload كنيد .


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- TWO STEPS TO INSTALL UPLOAD FILTER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document --><!-- STEP ONE: Paste this code into the HEAD of your HTML document --><HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
<SCRIPT language=JavaScript>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.ostadonline.com (http://njavan.com/forum/redirector.php?url=http%3A%2F%2Fwww.ostadonline.co m) -->
<!-- Begin
extArray = new Array(".gif", ".jpg", ".png");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Please only upload files that end in types: "
+ (extArray.join(" ")) + "\nPlease select a new "
+ "file to upload and submit again.");
}
// End -->
</SCRIPT>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<META content="MSHTML 6.00.2726.2500" name=GENERATOR></HEAD>
<BODY>
<CENTER>Please upload only images that end in:
<SCRIPT>
document.write(extArray.join(" "));
</SCRIPT>

<P>
<FORM name=upform action=/cgi-bin/some-script.cgi method=post
encType=multipart/form-data><INPUT type=file name=uploadfile>
<P><INPUT onclick="LimitAttach(this.form, this.form.uploadfile.value)" type=button value=Submit name=Submit>
</FORM></CENTER>
<P>
<CENTER><FONT face="arial, helvetica" size=-2>Free JavaScripts provided by
ostadonline<BR><!-- Script Size: 1.55 KB --></FONT></CENTER></BODY></HTML>

Asghar2000
13th April 2010, 01:27 PM
موضوع اسكريپت حركت يك كره در صفحه وب



با اين اسكريپت مي توان گلوله اي در صفحه قرار داد بعد از باز شدن صفحه در هر قسمتي از صفحه كه كليلك كنيد توپ به آن سمت پرتاب خواهد شد .


<!-- TWO STEPS TO INSTALL BALL DROP:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
function BrowserCheck() {
var b = navigator.appName;
if (b == "Netscape") this.b = "NS";
else if (b == "Microsoft Internet Explorer") this.b = "IE";
else this.b = b;
this.v = parseInt(navigator.appVersion);
this.NS = (this.b == "NS" && this.v>=4);
this.NS4 = (this.b == "NS" && this.v == 4);
this.NS5 = (this.b == "NS" && this.v == 5);
this.IE = (this.b == "IE" && this.v>=4);
this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
if (this.IE5 || this.NS5) this.VER5 = true;
if (this.IE4 || this.NS4) this.VER4 = true;
this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
this.min = (this.NS||this.IE);
}
is = new BrowserCheck();
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
Click anywhere to start script<br>
<div id="staticBall" style="position:relative;visibility:visible">
<img src="http://javascript.internet.com/img/ball-drop/ball.gif" height=30 width=30 alt="Static ball">
</div>
</center>
<div id="ball" style="visibility:hidden; position:absolute; left:100; top:10; height:34; width:34">
<img src="http://javascript.internet.com/img/ball-drop/ball.gif" height=30 width=30 alt="Bouncing ball">
</div>
<script language="Javascript1.2">
<!-- Begin
iter = 0;
setId = 0;
down = true;
up = false;
bouncingBall = (is.VER5) ? document.getElementById("ball").style
: (is.NS) ? document.layers["ball"]
: document.all["ball"].style;
stillBall = (is.VER5) ? document.getElementById("staticBall").style
: (is.NS) ? document.layers["staticBall"] : document.all["staticBall"].style;
winH = (is.NS) ? window.innerHeight - 55 : document.body.offsetHeight - 55;
document.onmouseup = buttonUp;
if (is.NS4)
document.captureEvents(Event.MOUSEUP);
function buttonUp(e) {
if ( ((is.NS) ? e.which : event.button) != 1) return true;
if (setId != 0) clearInterval(setId);
bouncingBall.visibility="visible";
stillBall.visibility="hidden";
bouncingBall.left = (is.NS) ? e.pageX - 15 : event.offsetX - 15;
bouncingBall.top = (is.NS) ? e.pageY - 15 : event.offsetY - 15;
iter = 0;
setId = setInterval("generateGravity()", 20);
return true;
}
function generateGravity() {
if ((parseInt(bouncingBall.top)+iter < winH) && down) {
bouncingBall.top = parseInt(bouncingBall.top) + iter;
iter++;
return;
}
else {
if ((parseInt(bouncingBall.top)< winH) && down) {
bouncingBall.top = winH + 5;
return;
}
down = false;
up = true;
if (iter < 0 && parseInt(bouncingBall.top) > winH) {
clearInterval(setId);
bouncingBall.visibility = "hidden";
stillBall.visibility="visible";
setId = 0;
}
if (parseInt(bouncingBall.top) > 0 && up && iter >= 0) {
bouncingBall.top = parseInt(bouncingBall.top) - iter;
iter--;
if (iter%3 == 0) iter--;
return;
}
down = true;
up = false;
}
}
// End -->
</script>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline
<!-- Script Size: 3.46 KB -->

Asghar2000
13th April 2010, 01:28 PM
موضوع اسكريپت شمارنده كلمات



اين كد به شما اجازه مي دهد كه كلمات يا كاراكترهايي را كه وارد يك فيلد متني مي كنيد شمارش كنيد و براي آن يك حد نصاب تعريف كنيد .



< !-- TWO STEPS TO INSTALL WORD COUNTER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -- >
< !-- STEP ONE: Paste this code into the HEAD of your HTML document -- >
< HEAD >
< SCRIPT LANGUAGE="JavaScript" >
< !-- This script and many more are available free online at -- >
< !-- The JavaScript Source!! http://WWW.OSTADONLINE.com -- >
< !-- Begin
var submitcount=0;
function checkSubmit() {
if (submitcount == 0)
{
submitcount++;
document.Surv.submit();
}
}

function wordCounter(field, countfield, maxlimit) {
wordcounter=0;
for (x=0;x<field.value.length;x++) {
if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ") {wordcounter++} // Counts the spaces while ignoring double spaces, usually one in between each word.
if (wordcounter > 250) {field.value = field.value.substring(0, x);}
else {countfield.value = maxlimit - wordcounter;}
}
}
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
{field.value = field.value.substring(0, maxlimit);}
else
{countfield.value = maxlimit - field.value.length;}
}
// End -- >
< /script >
< /HEAD >
< !-- STEP TWO: Copy this code into the BODY of your HTML document -- >
< BODY >
< !-- This script and many more are available free online at -- >
< !-- The JavaScript Source!! http://www.ostadonline.com -- >
< FORM NAME=Surv >
< TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3" width=550 >
< tr>< td valign="top" >
< font color="000000" size="2" face="verdana, helvetica, arial" >In 100 < b >words< /b > or less, why do you (or would you) like living on the coast?< /font >< font color="ff0000" size="2" face="verdana, helvetica, arial" >*< /font >
< td valign="top" >< textarea name="Q3367" cols="40" rows="5" wrap="hard" onKeyDown="wordCounter(this.form.Q3367,this.form.remLen,100);" onKeyUp="wordCounter(this.form.Q3367,this.form.remLen,100);" >< /textarea >
< br >Words remaining: < input type=box readonly name=remLen size=3 value=100 >< /td >< /tr >
< tr >< td colspan=2 >< hr width=80% >< /td >< /tr >
< tr >< td valign="top" >
< font color="000000" size="2" face="verdana, helvetica, arial" >In 100 < b >characters< /b > or less, why do you (or would you) like living on the coast?< /font >< font color="ff0000" size="2" face="verdana, helvetica, arial" >*< /font >
< td valign="top" >
< textarea name="Q336" cols="40" rows="5" wrap="hard" onKeyDown="textCounter(this.form.Q336,this.form.remLentext,10 0);" onKeyUp="textCounter(this.form.Q336,this.form.remLentext,10 0);" >< /textarea >
< br >Characters remaining: < input type=box readonly name=remLentext size=3 value=100 >
< /td >< /tr >
< /TABLE >
< INPUT TYPE="button" VALUE="Submit" onclick='' name=submit1 >
< INPUT TYPE="reset" VALUE="Reset" id=reset1 name=reset1 >
< /FORM >
< P >
< FONT SIZE="-2" COLOR="ff0000" FACE="verdana, helvetica, arial" >*< /FONT >< FONT SIZE="-2" COLOR="4169e1" FACE="verdana, helvetica, arial" Indicates a required question.< /FONT >

< p >< center >
< font face="arial, helvetica" size"-2" >Free JavaScripts provided by ostadonline< br >

< !-- Script Size: 3.38 KB -- >

Asghar2000
13th April 2010, 01:28 PM
موضوع اسكريپت ايجاد يك Pop Up



ايجاد يك Pop Up كه بتوان با طول و عرض خاصي و داشتن Scroll در جاي مشخص از صفحه و به URL مشخص مي باشد .



< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
< !-- TWO STEPS TO INSTALL CUSTOMIZED POPUP:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -- >< !-- STEP ONE: Paste this code into the HEAD of your HTML document -- >< HTML >< HEAD >
< META http-equiv=Content-Type content="text/html; charset=utf-8" >
< SCRIPT language=JavaScript >

< !-- Begin
function popupPage(l, t, w, h) {
var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no, resizable=yes" +
",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
var URL = "http://www.ostadonline.com";
popup = window.open(URL,"MenuPopup",windowprops);
}
// End -- >
< /SCRIPT >
< !-- STEP TWO: Copy this code into the BODY of your HTML document -- >
< META content="MSHTML 6.00.2800.1106" name=GENERATOR >< /HEAD >
< BODY >
< CENTER >
< TABLE >
< TBODY >
< TR >
< TD >
< FORM name=popupform >< PRE >Customize Your Popup Window!< BR >
Distance from left edge: < INPUT maxLength=4 size=2 name=left > pixels
Distance from top edge: < INPUT maxLength=4 size=2 name=top > pixels
Width of popup window: < INPUT maxLength=4 size=2 name=width > pixels
Height of popup window: < INPUT maxLength=4 size=2 name=height > pixels
< /PRE >
< CENTER >< INPUT onclick="popupPage(this.form.left.value, this.form.top.value, this.form.width.value, this.form.height.value)" type=button value="Open the Popup!" >
< /CENTER >< /FORM >< /TD >< /TR >< /TBODY >< /TABLE >< /CENTER >
< P >
< CENTER >< FONT face="arial, helvetica" size=-2 >Free JavaScripts provided
ostadonline < !-- Script Size: 1.48 KB -- >< /FONT >< /CENTER >< /BODY >< /HTML >

Asghar2000
13th April 2010, 01:29 PM
موضوع اسكريپت سئوال و جواب



به كمك اين اسكريپت شما مي توانيد جوابهايي براي سئوالات مطرح شده قرار دهيد بطوريكه كاربران با يك كليك آن را نبينند .


<!-- ONE STEP TO INSTALL QUESTION AND ANSWER:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>
<form name=answer><b>Q:ÇÒ å ÓÇíÊí ãí ÊæÇä ÇÓ˜ÑíÊ ÈÏÓÊ ÂæÑÏ¿</b>
<input type="button" name="submit" value=" !ÑÝÊä ÌæÇÈ" style="FONT-WEIGHT: bold; BACKGROUND: navy; WIDTH: 100px; COLOR: white" onclick="document.answer.mesaj1.value = 'ÈÇ ÓÇíÊ www.ostadonline.com (http://www.ostadonline.com) ';">
<input name=mesaj1 rows="2" cols="40" wrap="virtual" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 500px; BORDER-BOTTOM: medium none;color:red"
><br><b>Q:äÏ ÇÓ˜ÑíÊ ãí ÊæÇä ÏÑ Çíä ÓÇíÊ ÈÏÓÊ ÂæÑÏ¿</b>
<input type="button" name="submit" value=" !ÑÝÊä ÌæÇÈ " style="FONT-WEIGHT: bold; BACKGROUND: navy; WIDTH: 100px; COLOR: white" onclick="document.answer.mesaj2.value = ' ÏÑ ÍÏæÏ 50 ÇÓ˜ÑíÊ ';">
<input name=mesaj2 rows="2" cols="40" wrap="virtual" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 500px; BORDER-BOTTOM: medium none;color:red"
></form>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
</center><p>

<!-- Script Size: 1.49 KB -->

Asghar2000
13th April 2010, 01:29 PM
موضوع اسكريپت حساسيت ميدان Password به حروف بزرگ



اين اسكريپت زمان نوشتن كلمه ي رمز در ميدان متني در صورتيكه كليد Caps Lock كاربر روشن باشد پيغام خطا مي دهد .


<!-- ONE STEP TO INSTALL CHECK CAP LOCKS:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkCapsLock( e ) {
var myKeyCode=0;
var myShiftKey=false;
var myMsg='Caps Lock is On.\n\nTo prevent entering your password incorrectly,\nyou should press Caps Lock to turn it off.';
// Internet Explorer 4+
if ( document.all ) {
myKeyCode=e.keyCode;
myShiftKey=e.shiftKey;
// Netscape 4
} else if ( document.layers ) {
myKeyCode=e.which;
myShiftKey=( myKeyCode == 16 ) ? true : false;
// Netscape 6
} else if ( document.getElementById ) {
myKeyCode=e.which;
myShiftKey=( myKeyCode == 16 ) ? true : false;
}
// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) {
alert( myMsg );
// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
} else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) {
alert( myMsg );
}
}
// End -->
</script>
<FORM>
<STRONG>Password:</STRONG>
<INPUT TYPE="Password" NAME="Password" SIZE=16 MAXLENGTH=16 onKeyPress="checkCapsLock( event )">
<P>
<INPUT TYPE="Reset">
</FORM>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 1.71 KB -->

Asghar2000
13th April 2010, 01:30 PM
موضوع اسكريپت اتصال به URL از طريق يك Checkbox



اين اسكريپت هنگامي كه كاربر بر روي Check box تيك مي زند به URL خاصي هدايت مي شود.


<!-- ONE STEP TO INSTALL CHECKBOX LINK:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>

<center>
<form>
<input type=checkbox onclick="window.location='http://www.OSTADONLINE.com/index.asp'; return true;">New JavaScripts
</form>
</center>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided by ostadonline

Asghar2000
13th April 2010, 01:30 PM
موضوع اسكريپت بستن پنجره



با بكار بردن اين اسكريپت بعد از مدت زمانيكه مقدار آن در كد نويسي تعريف مي شود پيغامي مبني بر تاييد بسته شدن پنجره براي كاربر ظاهر خواهد شد

<!-- ONE STEP TO INSTALL CLOSE WINDOW:
1. Add the onLoad event handler into the BODY tag -->
<!-- STEP ONE: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="setTimeout(window.close, 5000)">

<!-- Then use the script at
http://navigation.javascriptsource.com/popup-page.html
to easily open a window, and then this one if you
need to close it after a certain number of seconds.
-->
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 0.57 KB -->

Asghar2000
13th April 2010, 01:31 PM
موضوع اسكريپت سفارشي كردن يك پنجره



اين اسكريپت به كاربر اجازه مي دهد كه يك پنجره ي جديد با شرايطي كاملا دلخواه و اختياري ايجاد كند .



<!-- TWO STEPS TO INSTALL CUSTOMIZED WINDOW:
1. Paste the coding into the HEAD of your HTML document
2. Put the last code into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function customize(form) {
var address = document.form1.url.value;
var op_tool = (document.form1.tool.checked== true) ? 1 : 0;
var op_loc_box = (document.form1.loc_box.checked == true) ? 1 : 0;
var op_dir = (document.form1.dir.checked == true) ? 1 : 0;
var op_stat = (document.form1.stat.checked == true) ? 1 : 0;
var op_menu = (document.form1.menu.checked == true) ? 1 : 0;
var op_scroll = (document.form1.scroll.checked == true) ? 1 : 0;
var op_resize = (document.form1.resize.checked == true) ? 1 : 0;
var op_wid = document.form1.wid.value;
var op_heigh = document.form1.heigh.value;
var option = "toolbar="+ op_tool +",location="+ op_loc_box +",directories="
+ op_dir +",status="+ op_stat +",menubar="+ op_menu +",scrollbars="
+ op_scroll +",resizable=" + op_resize +",width=" + op_wid +",height="+ op_heigh;
var win3 = window.open("", "what_I_want", option);
var win4 = window.open(address, "what_I_want");
}
function clear(form) {
document.form1.wid.value="";
document.form1.heigh.value="";
}
// End -->
</SCRIPT>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<CENTER>
<h4>Please choose from the following selections to customize your window</h4>
<br>
<TABLE cellpadding=5 border><TR><TD><PRE>
<FORM name=form1 ACTION="javascript:" METHOD="POST">
<INPUT TYPE="text" NAME="url" value="http://www.ostadonline.com" >: URL
<INPUT TYPE="checkbox" NAME="tool">: Toolbar
<INPUT TYPE="checkbox" NAME="loc_box">: Location
<INPUT TYPE="checkbox" NAME="dir">: Directories
<INPUT TYPE="checkbox" NAME="stat">: Status
<INPUT TYPE="checkbox" NAME="menu">: Menubar
<INPUT TYPE="checkbox" NAME="scroll">: Scrollbars
<INPUT TYPE="checkbox" NAME="resize">: Resizable
<INPUT TYPE="text" NAME="wid" value= >: Width
<INPUT TYPE="text" NAME="heigh" value=>: Height
<BR><CENTER>
<INPUT TYPE="button" VALUE="=ENTER=" OnClick="customize(this.form)">
<INPUT TYPE="reset" VALUE="=RESET=" onClick="clear(this.form)">
</PRE></TD></TR></TABLE>
</FORM>
</CENTER>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline
<!-- Script Size: 2.54 KB -->

Asghar2000
13th April 2010, 01:31 PM
موضوع اسكريپت تاريخ و زمان جاري



اين اسكريپت تاريخ و زمان جاري را به كاربر نشان مي دهد .


<!-- ONE STEP TO INSTALL CURRENT DATE & TIME (SHORT):
1. Put the last code into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<BODY>
<SCRIPT>
document.write(Date()+".")
</SCRIPT>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided by ostadonline
<!-- Script Size: 0.30 KB -->

Asghar2000
13th April 2010, 01:31 PM
موضوع اسكريپت تاييد اعداد در مبناي هگزا دسيمال در Edit Box



اين اسكريپت به كاربر اجازه مي دهد كه فقط اعداد در مبناي دسيمال را وارد ميدان متني شود و بقيه ي اعداد توسط اين اسكريپت باز گردانده مي شود . براي مثال وقتي شما اعداد 99 يا 99.9 يا 99.99 را وارد كنيد پيغام خطا ظاهر نمي شود ولي عدد 99.999 باز گردانده مي شود .



<!-- TWO STEPS TO INSTALL DECIMALS ALLOWED:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function checkDecimals(fieldName, fieldValue) {
decallowed = 2; // how many decimals are allowed?
if (isNaN(fieldValue) || fieldValue == "") {
alert("Oops! That does not appear to be a valid number. Please try again.");
fieldName.select();
fieldName.focus();
}
else {
if (fieldValue.indexOf('.') == -1) fieldValue += ".";
dectext = fieldValue.substring(fieldValue.indexOf('.')+1, fieldValue.length);
if (dectext.length > decallowed)
{
alert ("Oops! Please enter a number with up to " + decallowed + " decimal places. Please try again.");
fieldName.select();
fieldName.focus();
}
else {
alert ("That number validated successfully.");
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form>
Please enter a number with up to 2 decimal places: <br>
<input type=text name=numbox>
<input type=button name=ok value="Ok" onClick="checkDecimals(this.form.numbox, this.form.numbox.value)">
</form>
</center>
<p><center>
<font face="arial, helvetica" SIZE="-2">Free JavaScripts provided by ostadonline
<!-- Script Size: 1.42 KB -->

Asghar2000
13th April 2010, 01:32 PM
موضوع اسكريپت منوهاي قابل ويرايش



اين اسكريپت به كاربر اجازه مي دهد كه مواردي كه در منوهاي انتخابي وجود دارد را به دلخواه خود ويرايش كند ضمنا در اين منو مي توانيد مواردي كه غير قابل ويرايش باشند را نيز اضافه كنيد .


<!-- TWO STEPS TO INSTALL EDITABLE MENU:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site: http://www7.ewebcity.com/cyanide7 -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var o = null;
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function beginEditing(menu) {
finish();
if(menu[menu.selectedIndex].value != "read-only") {
o = new Object();
o.editOption = menu[menu.selectedIndex];
o.editOption.old = o.editOption.text;
o.editOption.text = "_";
menu.blur();
window.focus();
document.onkeypress = keyPressHandler;
}
function keyPressHandler(e){
var option = o.editOption;
var keyCode = (isNN) ? e.which : event.keyCode;
if(keyCode == 8 || keyCode == 37)
option.text = option.text.substring(0,option.text.length-2) + "_";
else if (keyCode == 13) {
finish();
} else
option.text = option.text.substring(0,option.text.length-1) + String.fromCharCode(keyCode) + "_";
status = keyCode;
}
function finish() {
if(o != null) {
option = o.editOption;
if(option.text.length > 1)
option.text = option.text.substring(0,option.text.length-1);
else
option.text = option.old;
document.onkeypress = null;
o = null;
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form>
<select onChange="beginEditing(this);" size=7>
<option value="read-only">Select an option to edit it.</option>
<option value="read-only"> ---------------------------- </option>
<option value="last">SurName</option>
<option value="first">FirstName</option>
<option value="email">Email</option>
<option value="add1">Address 1</option>
<option value="add2">Address 2</option>
</select>
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 2.12 KB -->

Asghar2000
13th April 2010, 01:32 PM
موضوع اسكريپت اخطار براي آدرس Email اشتباه



اين اسكريپت چناچنه كاربر از كاراكترهاي نامناسب براي نوشتن آدرس Email استفاده كند پيغام خطا خواهد داد .


<!-- TWO STEPS TO INSTALL EMAIL ADDRESS VALIDATION:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- Changes:
/* 1.1.4: Fixed a bug where upper ASCII characters (i.e. accented letters
international characters) were allowed.
1.1.3: Added the restriction to only accept addresses ending in two
letters (interpreted to be a country code) or one of the known
TLDs (com, net, org, edu, int, mil, gov, arpa), including the
new ones (biz, aero, name, coop, info, pro, museum). One can
easily update the list (if ICANN adds even more TLDs in the
future) by updating the knownDomsPat variable near the
top of the function. Also, I added a variable at the top
of the function that determines whether or not TLDs should be
checked at all. This is good if you are using this function
internally (i.e. intranet site) where hostnames don't have to
conform to W3C standards and thus internal organization e-mail
addresses don't have to either.
Changed some of the logic so that the function will work properly
with Netscape 6.
1.1.2: Fixed a bug where trailing . in e-mail address was passing
(the bug is actually in the weak regexp engine of the browser; I
simplified the regexps to make it work).
1.1.1: Removed restriction that countries must be preceded by a domain,
so abc@host.uk is now legal. However, there's still the
restriction that an address must end in a two or three letter
word.
1.1: Rewrote most of the function to conform more closely to RFC 822.
1.0: Original */
// -->
<!-- Begin
function emailCheck (emailStr) {
/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD. 1 means check it, 0 means don't. */
var checkTLD=1;
/* The following is the list of known TLDs that an e-mail address must end with. */
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|c oop|info|pro|museum)$/;
/* The following pattern is used to check if the entered e-mail address
fits the user@domain format. It also is used to separate the username
from the domain. */
var emailPat=/^(.+)@(.+)$/;
/* The following string represents the pattern for matching all special
characters. We don't want to allow special characters in the address.
These characters include ( ) < > @ , ; : \ " . [ ] */
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\ (file://\\(\\)><@,;:\\\\\\\"\\.\\[\\)]";
/* The following string represents the range of characters allowed in a
username or domainname. It really states which chars aren't allowed.*/
var validChars="\[^\\s" + specialChars + "\]";
/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes). E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")";
/* The following pattern applies for domains that are IP addresses,
rather than symbolic names. E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
/* The following string represents an atom (basically a series of non-special characters.) */
var atom=validChars + '+';
/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")";
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
/* Finally, let's start trying to figure out if the supplied address is valid. */
/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */
alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
// Start by checking that only basic ASCII characters are in the strings (0-127).
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
}
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
}
}
// See if "user" is valid
if (user.match(userPat)==null) {
// user is not valid
alert("The username doesn't seem to be valid.");
return false;
}
/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
// this is an IP address
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
}
}
return true;
}
// Domain is symbolic name. Check if it's valid.

var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
}
}
/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding
the domain or country. */
if (checkTLD && domArr[domArr.length-1].length!=2 &&
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}
// Make sure there's a host name preceding the domain.
if (len<2) {
alert("This address is missing a hostname!");
return false;
}
// If we've gotten this far, everything's valid!
return true;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form name=emailform onSubmit="return emailCheck(this.email.value)">
Your Email Address: <input type=text name="email"><br>
<input type=submit value="Submit">
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 6.98 KB -->

Asghar2000
13th April 2010, 01:33 PM
موضوع اسكريپت كليد Email



اين اسكريپت همراه با كليد به كاربران اجازه مي دهد كه با كليك بر روي كليد مورد نظر Email را به آدرس شخص مورد نظر ارسال كنيد و تذكر ضمنا از طريق اين اسكريپت مي توانيد موضوع Email را نيز تعيين كنيد .



<!-- ONE STEP TO INSTALL E-MAIL BUTTON:

1. Paste the coding into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->

<BODY>

<FORM>
<INPUT TYPE="button" VALUE="Click Here to Write to Me" onClick="parent.location='mailto:vlearning@etvto.ir'">
</FORM>
<FORM>
<INPUT TYPE="button" VALUE="Click Here to Write to Me - Subject training course" onClick="parent.location='mailto:vlearning@etvto.ir?subject =training courses'">
</FORM>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided
by OSTADONLINE

Asghar2000
13th April 2010, 01:33 PM
موضوع اسكريپت بزرگتر كردن عكس



شما نيازي به بزرگتر كردن عكس ها در صفحه نمايش براي كاربر نداريد . با اين اسكريپت كاربر با يك دبل كليك بر روي عكس سايز آن را افزايش مي دهد .


<!-- TWO STEPS TO INSTALL ENLARGE IMAGE:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function enlargeImage1(){
image1.height="300"
}
function dropImage1(){
image1.height="150"
}
function enlargeImage2(){
image2.height="300"
}
function dropImage2(){
image2.height="150"
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<b>Double-click the images to enlarge them<br>and click once to make them thumbnail size again.</b>
</center>
<p>
<table align="center">
<tr><td align="center">
<img src="http://www.ostadonline.com/img/network/cat5.jpg" height="150" name="image1" ondblclick="enlargeImage1()" onclick="dropImage1()"><br>
<b>Contemplation</b>
</td><td align="center">
<img src="http://www.ostadonline.com/img/network/bus.gif" height="150" name="image2" ondblclick="enlargeImage2()" onclick="dropImage2()"><br>
<b>Inner Reflection</b>
</td></tr>
</table>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 1.50 KB -->

Asghar2000
13th April 2010, 01:34 PM
موضوع اسكريپت Combo Box



اين اسكريپت به كاربران اجازه مي دهد كه موردي را كه مايل به پيگيري سايت يا صفحه وب آن هستند را از Combo box انتخاب كنند و فشردن كليد به صفحه مورد نظر هدايت شوند .



<!-- TWO STEPS TO INSTALL PULLDOWN MENU:
1. Paste the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
</HEAD>
<!-- STEP TWO: Paste this code into the BODY of your HTML document -->
<BODY>
<center>
<form name="form">
<select name="site" size=1>
<option value="">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.metacrawler.com">Metacrawler
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://javascript.internet.com">JavaScript Source
</select>
<input type=button value="Go!" onClick="javascript:formHandler(this)">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.20 KB -->

Asghar2000
13th April 2010, 01:34 PM
موضوع اسكريپت انبساط ميدان متني



اين اسكريپت بطور اتوماتيك با زياد شدن كاراكترهاي درون يك ميدان متني سايز آن را تا حدي كه در كد تعريف شده است افزايش مي دهد .


<!-- TWO STEPS TO INSTALL EXPANDING TEXTBOX:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function call_me(max_length) {
if((document.form1.mybox.value == null ) || (document.form1.mybox.value == "" )) document.form1.mybox.size = size;
if((document.form1.mybox.value.length >= size)&&(document.form1.mybox.value.length <= max_length)) document.form1.mybox.size = document.form1.mybox.value.length + 1;
else document.form1.mybox.size = size;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form name="form1">
LastName: <input type="text" style="font-family: Terminal" name="mybox" maxlength="30" size="10" onFocus="setInterval('call_me(document.form1.mybox.maxLengt h)', 1)">
<!--/style needs to be a font that has a fixed size attribute like TERMINAL/-->
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var size = document.form1.mybox.size; //Global Variable keeps original size
// End -->
</script>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided
by ostadonline
<!-- Script Size: 1.73 KB -->

Asghar2000
13th April 2010, 01:35 PM
موضوع اسكريپت باز كردن فايل



اين اسكريپت به كاربر اجازه مي دهد كه فايل دلخواهي از هارد خود را باز كرده و سپس آن را در پنجره جديد باز كند .


<!-- TWO STEPS TO INSTALL FILE OPEN:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Thank you Larry McClurg for the cross-browser fix
function whatFile() {
window.location= 'file:///' + document.form1.cmuds.value;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form name=form1>
<input type=file name="cmuds">
<input type=button onClick="whatFile()" value="Open File">
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 1.09 KB -->

Asghar2000
13th April 2010, 01:35 PM
موضوع اسكريپت درخشنده كردن منو با رد كردن ماوس بر آن



با اين اسكريپت منويي ايجاد مي شود كه با حركت ماوس كاربر بر روي آيتم هاي آن اين منو دچار تغيير رنگ و درخشندگي خاصي مي شود .


<!-- TWO STEPS TO INSTALL FLASHER:
1. Paste the coding into the HEAD of your HTML document
2. Copy the onLoad event handler into the BODY tag -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var message="The JavaScript Source is your JavaScript solution!! ";
var speed=400;
var visible=0;
function Flash() {
if (visible == 0) {
window.status=message;
visible=1;
} else {
window.status="";
visible=0;
}
setTimeout('Flash()', speed);
}
// End -->
</SCRIPT>
<!-- STEP TWO: Add this onLoad event handler into the BODY tag -->
<BODY onLoad="Flash()">
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 0.83 KB -->

Asghar2000
13th April 2010, 01:36 PM
موضوع اسكريپت چرخش



اين اسكريپت به طور ذاتي ما بين دو تصوير بدون ناهمواري لبه هاي تصوير چرخش ايجاد مي كند .


<!-- THREE STEPS TO INSTALL FLIPFLOP:

1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>
<SCRIPT language="JavaScript" type="text/javascript">
<!--hide

//STEP 1: PUT THIS CODE INTO THE HEAD OF YOUR DOCUMENT

var wdmax=120; //set maximum width of square image (px)
var wdmin=0; //set minimum thickness of edge-on image (px)
var inc=5; //set step change in px (wdmax-wdmin must be a multiple) )These two variables
var rate = 50; //pause between steps (in millisec) )determine flip-flop speed
var pause = 1000; //pause between flip and flop (in millisec)
var ff="flip"; //initialise whether movement starts with a "flip" (sideways) or "flop" (vertical) change.

function flipflop() {
if (ff=="flip") {
var wd = document.getElementById("pic").getAttribute("width");
wd = wd - inc;
document.getElementById("pic").setAttribute("width",wd);
if (wd==wdmin) {
document.getElementById("pic").setAttribute("src","pic2.gif"); //substitute name of your second picture
inc=-inc;
}
if (wd==wdmax) {
ff="flop";
inc=-inc;
setTimeout("flipflop()",pause);
}
else {
setTimeout("flipflop()",rate);
}
}
else {
var ht = document.getElementById("pic").getAttribute("height");
ht = ht - inc;
document.getElementById("pic").setAttribute("height",ht);
if (ht==wdmin) {
document.getElementById("pic").setAttribute("src","pic1.gif"); //substitute name of your first picture
inc=-inc;
}
if (ht==wdmax) {
ff="flip";
inc=-inc;
setTimeout("flipflop()",pause);
}
else {
setTimeout("flipflop()",rate);
}
}
}

-->
</SCRIPT>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="javascript:flipflop()">

<!-- STEP THREE: Copy this code into the BODY of your HTML document -->

<center>
<TABLE border="0">
<th width="160" height="160">
<IMG src="http://www.ostadonline.com/img/network/hub.jpg" width="120" height="120" ID="pic">
</th></TABLE>
<p>This script alternately "flips" and "flops" between two images, with adjustable smoothness, speed and pauses. It may be useful as an alternative to a crossfade, where you want to create movement to attract attention, or where you want to show two images with equal prominence that don't necessarily look well together (I wrote it to show two dissimilar corporate logos). Small images are less taxing on system resources and will appear smoother in operation.
<p>It is important that:<ol><li>The two images are square and of the same size, and<li>The difference between wdmax (maximum width of square image) and wdmin (minimum thickness edge-on image) is an exact multiple of inc (the step change); otherwise the image will flip once and disappear.</ol>
<p>If only requiring movement in one direction, set the "ff" variable to it, and delete or change the
subsequent resetting of this variable accordingly.</p>
</center>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided
by ostadonline
</p></center>

<!-- Script Size: 3.54 KB -->

Asghar2000
13th April 2010, 01:36 PM
موضوع اسكريپت رشد عكس



اين اسكريپت سايز يك عكس را به بزرگترين حدي كه در تابع براي آن تعريف شده است بصورت مرحله به مرحله افزايش مي دهد و فقط مخصوص مرورگرهاي IE مي باشد .



<!-- THREE STEPS TO INSTALL GROWING IMAGE:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var ival, imgname, total, steps, maxx, maxy, currentx, currenty, dx, dy;
function zoomImg(imgname, total, steps, maxx, maxy) {
// convert the total from seconds to miliseconds
total = total * 1000;
objref = eval("document.getElementById('"+imgname+"')");
currentx = objref.width;
currenty = objref.height;
// work out how much we need to increase the image by each step
// devide image sizes by number of steps to get the amount we need to change each step
stepx = maxx / steps;
stepy = maxy / steps;
// devide the total time (in ms) by the number of steps to get the interval time
inttime = total / steps;
// set the interval to increase the size of the image by the required pixels
functionRef = "resizeImg('"+imgname+"', "+stepx+", "+stepy+", "+maxx+", "+maxy+")";
ival = setInterval(functionRef, inttime);
}
function resizeImg(imgname, dx, dy, maxx, maxy) {
objref = eval("document.getElementById('"+imgname+"')");
currentx = objref.width;
currenty = objref.height;
if ((currentx<maxx-dx) && (currenty<maxy-dy)) {
objref.height = currenty + dy;
objref.width = currentx + dx;
}
else {
clearInterval(ival);
objref.height = maxy;
objref.width = maxx;
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="zoomImg('test', 10, 150, 300, 200)">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<div align="center"><img src="http://www.ostadonline.com/img/robotic/2.gif" name="test" id="test" height="2" width="3"></div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 2.24 KB -->

Asghar2000
13th April 2010, 01:37 PM
موضوع اسكريپت ورژن Java-Script



اين اسكريپت به كاربران اعلام مي كند كه مرورگر آنها از چه ورژني از Java-Script حمايت مي كند .


<!-- TWO STEPS TO INSTALL JAVASCRIPT VERSION:
1. Paste the first code in the HEAD of your HTML document
2. Add the last coding to the BODY of your HTML document -->
<!-- STEP ONE: Paste the first code in the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<
<!-- Begin
jsver = "1.0";
// End -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Begin
jsver = "1.1";
// End -->
</SCRIPT>
<SCRIPT Language="JavaScript1.2">
<!-- Begin
jsver = "1.2";
// End -->
</SCRIPT>
<SCRIPT Language="JavaScript1.3">
<!-- Begin
jsver = "1.3";
// End -->
</SCRIPT>
<NOSCRIPT>
<B>Your browser does not currently support JavaScript.</B>
<P>If your are using Netscape 2 or later then you can enable JavaScript.
<P>Version 2 or 3: Choose Options|Network Preferences, choose the Languages tab, click Enable Javascript and then click OK.
<P>Version 4: Choose Edit|Preferences|Advanced, click Enable JavaScript and then click OK.
<P><HR><P>
With Internet Explorer 5: Go to Tools Menu|Internet Options, Security Tab and click on the Custom Level. Then select disable active scripting under the scripting section.
</NOSCRIPT>
<!-- STEP TWO: Add the last coding to the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<B>Your browser supports JavaScript version " + jsver + ".</B>")
// End -->
</SCRIPT>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.50 KB -->

Asghar2000
13th April 2010, 01:37 PM
موضوع اسكريپت Marquee



اين اسكريپت متن را بصورت متحرك در طول صفحه حركت مي دهد .


<!-- ONE STEP TO INSTALL MARQUEE SCROLL:
1. Paste the coding into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: http://www.geocities.com/SiliconValley/Horizon/5235 -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
mesg = "The JavaScript Source, provided by ostadonline!";
isNS = (navigator.appName == "Netscape")
isIE = (navigator.appName == "Microsoft Internet Explorer")
text = ("<i><font size=2>"+mesg+"</font></i>")
if (isNS) {
document.write("<blink>" + text + "</blink>")}
else if (isIE) {
document.write("<MARQUEE BEHAVIOR=ALTERNATE DIRECTION=RIGHT>" + text + "</MARQUEE>")}
// End -->
</SCRIPT>
<NOSCRIPT>
<i><font size=2>The JavaScript Source, another marvelous use of bandwidth!</font></i>
</NOSCRIPT>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.00 KB -->

Asghar2000
13th April 2010, 01:37 PM
موضوع اسكريپت از بين بردن فضاهاي خالي ما بين كاراكترها



اين اسكريپت فضاي كه بين كاراكترها در هنگام نوشتن يك رشته در ميدان متني ايجاد مي شود را از بين مي برد .


<!-- TWO STEPS TO INSTALL IGNORE SPACES:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function ignoreSpaces(string) {
var temp = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<pre>
Before: String = x xx xxx xxxx<br>
After: String = <script language="JavaScript">
document.write(ignoreSpaces("x xx xxx xxxx"));
</script>
</pre>
</center>
<!-- Or, here is another example, in a form -->
<p>
<center>
Or, try entering a string with spaces in this box.
<form>
<input type=text size=25 onBlur="this.value=ignoreSpaces(this.value);">
<input type=button value="Ok">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.30 KB -->

Asghar2000
13th April 2010, 01:38 PM
موضوع اسكريپت ايجاد كليك با عكس



به اين اسكريپت به آساني به شما اجازه داده مي شود كه با هر عكس يك كليد ايجاد كنيد بطوريكه هنگاميكه كاربر ماوس را از روي آن رد كرد از مكان خود جابجا گردد .



<!-- TWO STEPS TO INSTALL IMAGE BUTTON:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<style>
<!--
.mouseBeOffMe {
border-top: 10px solid #FFFFFF;
border-bottom: 10px solid #FFFFFF;
border-left: 6px solid #FFFFFF;
border-right: 10px solid #FFFFFF;
}
.mouseBeOnMe {
border-top: 6px solid #FFFFFF;
border-bottom: 14px solid #FFFFFF;
border-left: 10px solid #FFFFFF;
border-right: 6px solid #FFFFFF;
}
.mouseBeDown {
border-top: 13px solid #FFFFFF;
border-bottom: 7px solid #FFFFFF;
border-left: 10px solid #FFFFFF;
border-right: 6px solid #FFFFFF;
}
.mouseBeUp {
border-top: 10px solid #FFFFFF;
border-bottom: 10px solid #FFFFFF;
border-left: 10px solid #FFFFFF;
border-right: 6px solid #FFFFFF;
}
//-->
</style>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<img src = "http://www.ostadonline.com/img/logo.gif"
title = "This is the Image Label"
width = "90"
height = "40"
border = "0"
class = "mouseBeOffMe"
onmouseover = "this.className='mouseBeOnMe'"
onmousedown = "this.className='mouseBeDown'"
onmouseup = "this.className='mouseBeUp'"
onmouseout = "this.className='mouseBeOffMe'">
<br>
<br>
Move your mouse over the image above. Try clicking on it also!
</center>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 1.83 KB -->

Asghar2000
13th April 2010, 01:38 PM
موضوع اسكريپت نمايش عكس بصورت Slide



اين اسكريپت به شما اجازه مي دهد كه چندين عكس انتخابي را با هم تحت يك كليد بصورت اسلايد نشان مي دهد .


<!-- TWO STEPS TO INSTALL IMAGE SLIDESHOW:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var rotate_delay = 5000; // delay in milliseconds (5000 = 5 secs)
current = 0;
function next() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
}
else first();
}
function previous() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
}
else last();
}
function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop") {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=slideform>
<table cellspacing=1 cellpadding=4 bgcolor="#000000">
<tr>
<td align=center bgcolor="white">
<b>Image Slideshow</b>
</td>
</tr>
<tr>
<td align=center bgcolor="white" width=200 height=150>
<img src="cart.gif" name="show">
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0">
<select name="slide" onChange="change();">
<option value="http://www.ostadonline.com/img/robotic/1.gif" selected>pic1
<option value="http://www.ostadonline.com/img/robotic/2.gif">pic2
<option value="http://www.ostadonline.com/img/robotic/4.gif">pic3
<option value="http://www.ostadonline.com/img/robotic/12.gif">pic4
<option value="http://www.ostadonline.com/img/robotic/15.gif">pic5
<option value="http://www.ostadonline.com/img/robotic/100.gif">pic6
<option value="http://www.ostadonline.com/img/robotic/103.gif">pic7
<option value="http://www.ostadonline.com/img/robotic/98.gif">pic8
<option value="http://www.ostadonline.com/img/robotic/102.gif">pic9
<option value="http://www.ostadonline.com/img/robotic/101.gif">pic10
</select>
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0">
<input type=button onClick="first();" value="|<<" title="Beginning">
<input type=button onClick="previous();" value="<<" title="Previous">
<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
<input type=button onClick="next();" value=">>" title="Next">
<input type=button onClick="last();" value=">>|" title="End">
</td>
</tr>
</table>
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided
by ostadonline
</center><p>
<!-- Script Size: 3.24 KB -->

Asghar2000
13th April 2010, 01:39 PM
موضوع اسكريپت سايز صفحه نمايش



اين اسكريپت سايز صفحه نمايش كاربران را بر اساس طول و عرض بر مقياس pixel به كاربران ارائه مي كند .


<!-- ONE STEP TO INSTALL SCREEN SIZE:
1. Paste the coding into the HEAD of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
alert('Your screen is:\n\n' + screen.width + ' pixels by ' + screen.height + ' pixels');
// End -->
</SCRIPT>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
</center><p>
<!-- Script Size: 0.51 KB -->

Asghar2000
13th April 2010, 01:39 PM
موضوع اسكريپت كليدهاي بالا و پايين



بوسيله اين اسكريپت و دگمه هايي كه ايجاد مي شود به كاربر اجازه مي دهد كه با كليك بر روي كليدهاي بالا و پايين عدد نوشته شده در ميدان متني را بالا و پايين ببرد . نيز كاربر مي تواند عددي در اين ميدان وارد كند و سپس با كليدها آن را كمتر و بيشتر كند .



<!-- ONE STEP TO INSTALL UP & DOWN BOX:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<center>
<form>
<input type=text name=amount value=5>
<input type=button value="up" onClick="javascript:this.form.amount.value++;">
<input type=button value="down" onClick="javascript:this.form.amount.value--;">
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by ostadonline
<!-- Script Size: 0.45 KB -->

Asghar2000
13th April 2010, 01:40 PM
معرفی منبع - تماس با نویسنده



منبع : گردآوری شده از سایت های اینترنتی ارائه دهنده Source های جاوا اسکریپت

http://www.ostadonline.com/img/mail/zarabian.jpg

استفاده از تمامی مطالب سایت تنها با ذکر منبع آن به نام سایت علمی نخبگان جوان و ذکر آدرس سایت مجاز است

استفاده از نام و برند نخبگان جوان به هر نحو توسط سایر سایت ها ممنوع بوده و پیگرد قانونی دارد