»» به هنگام استفاده از کدها به موارد ذیل توجه نمایید:
|
.progress{
width: 1px;
height: 14px;
color: white;
font-size: 12px;
overflow: hidden;
background-color: navy;
padding-left: 5px;
}
</style>
<script type="text/JavaScript">
function textCounter(field,counter,maxlimit,linecounter) {
// text width//
var fieldWidth = parseInt(field.offsetWidth);
var charcnt = field.value.length;
// trim the extra text
if (charcnt > maxlimit) {
field.value = field.value.substring(0, maxlimit);
}
else {
// progress bar percentage
var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px";
document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
// color correction on style from CCFFF -> CC0000
setcolor(document.getElementById(counter),percentage,"background-color");
}
}
function setcolor(obj,percentage,prop){
obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
</script>
</head>
<body>
<form>
<textarea rows="5" cols="40" name="maxcharfield" id="maxcharfield"
onKeyDown="textCounter(this,'progressbar1',20)"
onKeyUp="textCounter(this,'progressbar1',20)"
onFocus="textCounter(this,'progressbar1',20)" ></textarea><br />
<div id="progressbar1" class="progress"></div>
<script>textCounter(document.getElementById("maxcharfield"),"progressbar1",20)</script>
</form>
</body>




//Autumn leaves- by Kurt Grigg (kurt.grigg@virgin.net)
//Modified by Dynamic Drive for NS6 functionality
//visit http://www.dynamicdrive.com for this script
//Pre-load your image below!
grphcs=new Array(6)
Image0=new Image();
Image0.src=grphcs[0]="img9.gif";
Image1=new Image();
Image1.src=grphcs[1]="img8-01.gif"
Image2=new Image();
Image2.src=grphcs[2]="img8-02.gif"
Image3=new Image();
Image3.src=grphcs[3]="img8-03.gif"
Image4=new Image();
Image4.src=grphcs[4]="img8-04.gif"
Image5=new Image();
Image5.src=grphcs[5]="img8-05.gif"
Amount=8; //Smoothness depends on image file size, the smaller the size the more you can use!
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px; z-index:100"><div style="position:relative">');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
Ypos[i] = Math.round(Math.random()*WinHeight);
Xpos[i] = Math.round(Math.random()*WinWidth);
Speed[i]= Math.random()*5+3;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
}
function fall(){
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(90*Math.PI/120);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else if (ns6){
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
}
else{
eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',30);
}

#dhtmltooltip{
position: absolute;
width: 150px;
border: 1px solid #444444;
padding: 2px;
background-color: #ffffdd;
visibility: hidden;
z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
/*filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=125);*/
}
#dhtmlpointer{
position:absolute;
z-index: 101;
visibility: hidden;
}
</style>
<script type="text/javascript">
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip
var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=12 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="../images/spacer.gif">') //write out pointer image
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}
function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}
//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}
function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="0px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip
</script><form name="jumpy" >
<select name="example" size="1" onChange="gone()">
<!-- CHANGE THE BELOW URLS TO YOUR OWN-->
<option value="http://www.yahoo.com" selected>Yahoo</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.amazon.com">Amazon</option>
<option value="http://www.AltaVista.com">AltaVista</option>
</select>
<input type="button" name="test" value=" Go! " onClick="gone()">
</form>
</div>
<script language="javascript">
<!--
//Specify display mode (0 or 1)
//0 causes document to be displayed in an inline frame, while 1 in a new browser window
var displaymode=0
//if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
var iframecode='<iframe id="external" style="width:100%;height:450px; border: 1px dashed #999999" src="http://www.yahoo.com"></iframe>'
/////NO NEED TO EDIT BELOW HERE////////////
if (displaymode==0)
document.write(iframecode)
<!-- Do not edit IE conditional style below -->
<!--[if gte IE 5.5]>
<style type="text/css">
#motioncontainer {
width:expression(Math.min(this.offsetWidth, maxwidth)+'px');
}
</style>
<![endif]-->
<!-- End Conditional Style -->
<script type="text/javascript" src="motiongallery.js"></script>
<style type="text/css">
#motioncontainer {
WIDTH: 50%; height: 142px
}
#motioncontainer A IMG {
BORDER-RIGHT: #aaaaaa 1px solid; BORDER-TOP: #aaaaaa 1px solid; BORDER-LEFT: #aaaaaa 1px solid; BORDER-BOTTOM: #aaaaaa 1px solid
}
#motioncontainer A:hover IMG {
BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed
}
#statusdiv {
BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 2px; LEFT: -300px; VISIBILITY: hidden; PADDING-BOTTOM: 2px; BORDER-LEFT: gray 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: gray 1px solid; POSITION: absolute; background-color:#ffffcc
}
#motioncontainer A:hover {
COLOR: #cc0000
}
</style>
</head>
<body>
<div id="motioncontainer" style="position:relative;overflow:hidden">
<div id="motiongallery" style="position:absolute;left:0;top:0;white-space: nowrap">
<span id="trueContainer"><a href="javascript:enlargeimage('sample.gif')"><img src="sample.gif" border=1></a> <a href="javascript:enlargeimage('sample.gif', 300, 300)"><img src="sample.gif" border=1></a> <a href="http://www.webkaran.com"><img src="sample.gif" border=1></a> <a href="#"><img src="sample.gif" border=1></a> <a href="#"><img src="sample.gif" border=1></a> <a href="#"><img src="sample.gif" border=1></a> <a href="#"><img src="sample.gif" border=1></a> <a href="#"><img src="sample.gif" border=1></a> <a href="#"><img src="sample.gif" border=1></a></span>
</div>| motiongallery.js :دانلود فایل ضمیمه |
<!-- Print Page Script
Use this script to have your
users print your HTML page
-->
<script language="JavaScript">
if (window.print) {
document.write(' '
+ '<input type=button name=print value="Click" '
+ 'onClick="javascript:window.print()"> To Print this page!');
}
// End -->
</script>
<!-- -- No: 02 ----------------- Icon Type ----- -->
<script language="JavaScript" type="text/javascript">function hyperlinks(target){
if (target) where = newwindow;
else where = "_self";
for (var i=0; i<=(document.links.length-1); i++){
var linkobj=document.links[i].href
if ( linkobj.indexOf("javascript:") ==-1 && linkobj.indexOf("#") ==-1){
if (target && where!="_blank") //DynamicDrive.com added routine- open window in set secondary window
document.links[i].onclick=function(){
if (window.window2 && !window2.closed)
window2.location=this.href
else
window2=window.open(this.href)
window2.focus()
return false
}
else{
if (newwindow=="window2") document.links[i].onclick = "";
document.links[i].target = where;
}
}
}
}
function inithyperlinks(){ //DynamicDrive.com added routine
if (document.targetform.targetnew.checked)
hyperlinks(true)
}
window.onload=inithyperlinks
// -->
</SCRIPT>
</head>
switch (month) {
case 1: (day<21)? (month=10, day+=10):(month=11, day-=20); break;
case 2: (day<20)? (month=11, day+=11):(month=12, day-=19); break;
case 3: (day<21)? (month=12, day+=9):(month=1, day-=20); break;
case 4: (day<21)? (month=1, day+=11):(month=2, day-=20); break;
case 5:
case 6: (day<22)? (month-=3, day+=10):(month-=2, day-=21); break;
case 7:
case 8:
case 9: (day<23)? (month-=3, day+=9):(month-=2, day-=22); break;
case 10:(day<23)? (month=7, day+=8):(month=8, day-=22); break;
case 11:
case 12:(day<22)? (month-=3, day+=9):(month-=2, day-=21); break;
default: break;
}
}
if (y==2) {
year -= ( (month < 3) || ((month == 3) && (day < 20)) )? 622:621;
switch (month) {
case 1: (day<21)? (month=10, day+=10):(month=11, day-=20); break;
case 2: (day<20)? (month=11, day+=11):(month=12, day-=19); break;
case 3: (day<20)? (month=12, day+=10):(month=1, day-=19); break;
case 4: (day<20)? (month=1, day+=12):(month=2, day-=19); break;
case 5: (day<21)? (month=2, day+=11):(month=3, day-=20); break;
case 6: (day<21)? (month=3, day+=11):(month=4, day-=20); break;
case 7: (day<22)? (month=4, day+=10):(month=5, day-=21); break;
case 8: (day<22)? (month=5, day+=10):(month=6, day-=21); break;
case 9: (day<22)? (month=6, day+=10):(month=7, day-=21); break;
case 10:(day<22)? (month=7, day+=9):(month=8, day-=21); break;
case 11:(day<21)? (month=8, day+=10):(month=9, day-=20); break;
case 12:(day<21)? (month=9, day+=10):(month=10, day-=20); break;
default: break;
}
}
if (y==3) {
year -= ( (month < 3) || ((month == 3) && (day < 21)) )? 622:621;
<!--
function RandomNumber()
{
var today = new Date();
var num= Math.abs(Math.sin(today.getTime()/1000));
return num;
}
function RandomGraphics()
{
var x = RandomNumber();
if (x > .77)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > .66)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > .55)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > .44)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > .33)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > .22)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > .11)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
if (x > 0)
{document.write("<A HREF='URL'><img src='مسیر تصویر مورد نظر ' alt=" " hspace=10></a>");
return;
}
}
RandomGraphics();
//--></SCRIPT>
| همچنین به تگ body صفحه عبارت onload="RandomNumber()" را اضافه نمایید. |
<!-- Format: October: 17, 2008
-->
<head>
<script language="javascript" type="text/javascript">
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
var today_date= new Date()
var month=today_date.getMonth()
var today=today_date.getDate()
var year=today_date.getYear()
var months = new Array(
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
// -->
</script>
</head>
| همچنین به تگ body صفحه عبارت onload="change()" را اضافه نمایید. |
#leftright, #topdown{
position: absolute;
left: 0;
top: 0;
width: 1px;
height: 1px;
layer-background-color: #aaaaaa;
background-color: #aaaaaa;
z-index: 100;
font-size: 1px;
}
-->
</style>
<!-- Put this code after your <BODY> tag -->
<div id="leftright" style="width:expression(document.body.clientWidth-2)"></div>
<div id="topdown" style="height:expression(document.body.clientHeight-2)"></div>
<script language="JavaScript1.2">
<!--
if (document.all&&!window.print){
leftright.style.width=document.body.clientWidth-2
topdown.style.height=document.body.clientHeight-2
}
else if (document.layers){
document.leftright.clip.width=window.innerWidth
document.leftright.clip.height=1
document.topdown.clip.width=1
document.topdown.clip.height=window.innerHeight
}
function followmouse1(){
//move cross engine for IE 4+
leftright.style.pixelTop=document.body.scrollTop+event.clientY+1
topdown.style.pixelTop=document.body.scrollTop
if (event.clientX<document.body.clientWidth-2)
topdown.style.pixelLeft=document.body.scrollLeft+event.clientX+1
else
topdown.style.pixelLeft=document.body.clientWidth-2
}
function followmouse2(e){
//move cross engine for NS 4+
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}
if (document.all)
document.onmousemove=followmouse1
else if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}
function regenerate(){
window.location.reload()
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400)
}
if ((document.all&&!window.print)||document.layers)
//if the user is using IE 4 or NS 4, both NOT IE 5+
window.onload=regenerate2
<body>
<A onClick="archives('archives'); return false;" href="#">Click Here</a>| 1- کد زیر را در قسمت head صفحه کپی نمایید |
| 2- این بخش از کد را در قسمت body ، خارج از هر تگ دیگری کپی کنید. |
| 3- کد زیر را در محل مورد نظر خود کپی نمایید |
<style type="text/css"> body { <SCRIPT SRC="ssm.js" language="JavaScript1.2"></SCRIPT> <SCRIPT SRC="ssmItems.js" language="JavaScript1.2"></SCRIPT> |
| دانلود فایل ضمیمه: js_SideMenu.zip |
| <script> if (!document.div) document.write('<div id="divStayTopLeft" style="position:absolute">') </script> <div id="divStayTopLeft"> <!--EDIT BELOW CODE TO YOUR OWN MENU--> <script type="text/javascript"> //Enter "frombottom" or "fromtop" if (!document.layers) function JSFX_FloatTopDiv() |


