از اين به بعد هر روز يه java script يا Dhtml script ---> امروز ---> ساعت

AliReza26

Active Member
سلام
اينم كد امروز :

موضوع : نشان دادن مختصات نشانگر موس در استاتوس بار

کد:
<script language="javascript">

//Display Mouse coordinates- By Kous ([email protected])
//Visit http://javascriptkit.com for this script and more

var where = ""; // which link
function checkwhere(e) {
        if (document.layers){
        xCoord = e.x;
        yCoord = e.y;
}
        else if (document.all){
        xCoord = event.clientX;
        yCoord = event.clientY;
}
        else if (document.getElementById){
        xCoord = e.clientX;
        yCoord = e.clientY;
}
        self.status = "X= "+ xCoord + "  Y= " + yCoord; 
        }


document.onmousemove = checkwhere;
if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}

</script>
 

AliReza26

Active Member
سلام
كد امروز هم اينه :

موضوع : Auto Tab

کد:
<script>

/*
Auto tabbing script- By JavaScriptKit.com
http://www.javascriptkit.com
This credit MUST stay intact for use
*/

function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}

</script>

<b>Enter your 10-digit phone number:</b>
<form name="sampleform">
<input type="text" name="first" size=4 onKeyup="autotab(this, document.sampleform.second)" maxlength=3> <input type="text" name="second" size=4 onKeyup="autotab(this, document.sampleform.third)" maxlength=3> <input type="text" name="third" size=5 maxlength=4>

</form>
 

AliReza26

Active Member
سلام

اينم واسه امروز
موضوع : selectAll

کد:
<script language="Javascript">

function selectAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
}
//-->
</script>



<form name="test">
<a href="javascript:selectAll('test.select1')">Select All</a><br>
<textarea name="select1" rows=10 cols=20>This is some text. This is some text. This is some text. This is some text.</textarea>
</form>
 

جدیدترین ارسال ها

بالا