|
|
| JavaScript Discuss about JavaScript problems you are having or help others with their JavaScript issues. |

01-15-2010, 12:46 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Dancing Animation Stars Cursor
One of the many cursor codes in our JavaScript library, this one creates dancing stars animating around your pointers mouse. This cur... detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/mouse/dancing-animation-stars-cursor.jpg[/IMG]
Demo: JavaScript Dancing Animation Stars Cursor
[SIZE="4"] How to setup[/SIZE]
Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<script language="JavaScript">
<!--
/*
Dancing Stars cursor (Submitted by Kurt at kurt.grigg@virgin. net)
Modified and permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit hxxp ://dynamicdrive. com
*/
if (document.all){
document.write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
for (xy=0;xy<7;xy++)
document.write('<div style="position:relative;width:3px;height:3px;background:#FFFF00;font-size:2px;visibility:visible"></div>')
document.write('</div>')
}
if (document.layers)
{window.captureEvents(Event.MOUSEMOVE);}
var yBase = 200;
var xBase = 200;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 1;
var Ypos = 1;
var i = 0;
var j = 0;
if (document.all)
{
function MoveHandler(){
Xpos = document.body.scrollLeft+event.x;
Ypos = document.body.scrollTop+event.y;
}
document.onmousemove = MoveHandler;
}
else if (document.layers)
{
function xMoveHandler(evnt){
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = xMoveHandler;
}
function animateLogo() {
if (document.all)
{
yBase = window.document.body.offsetHeight/4;
xBase = window.document.body.offsetWidth/4;
}
else if (document.layers)
{
yBase = window.innerHeight/4 ;
xBase = window.innerWidth/4;
}
if (document.all)
{
var totaldivs=document.all.starsDiv.all.length
for ( i = 0 ; i < totaldivs ; i++ )
{
var tempdiv=document.all.starsDiv.all[i].style
tempdiv.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
tempdiv.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
}
}
else if (document.layers)
{
for ( j = 0 ; j < 7 ; j++ )
{
var templayer="a"+j
document.layers[templayer].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
document.layers[templayer].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
}
}
currStep += step;
setTimeout("animateLogo()", 15);
}
animateLogo();
// -->
</script>
Step 2: Place HTML below in your BODY section
HTML
Code:
<LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
<LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
<LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
<LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
<LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
<LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
<LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
JavaScript Line Graph script - JavaScript Virtual Keyboard - JavaScript Horizontal Slider
|

02-03-2010, 05:05 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Up-down floating image
Floating background image script animates any image (or block of HTML) up and down the detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/image/up-down-floating-image.jpg[/IMG]
Demo: JavaScript Up-down floating image
[SIZE="4"] How to setup[/SIZE]
Step 1: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<SCRIPT>
//detecting browser to dynamically write appropriate DIVs/LAYERs
N=(navigator.appName.indexOf('Netscape')!=-1&&parseInt(navigator.appVersion)<5)
S=(navigator.appName.indexOf('Netscape')!=-1&&parseInt(navigator.appVersion)>4.9)
M=(navigator.appName.indexOf('Microsoft')!=-1)
Vis=new Array()
Vis[0]=(M||S) ? "hidden" : "hide"
Vis[1]=(M||S) ? "visible" : "show"
function GetDiv(divId,divY,divX,divW,divH,bCol,visb,zInd){
bkCol=(bCol!="")?((N)?" bgColor="+bCol:";background:"+bCol):""
Styl = (M||S) ? "<DIV" : "<LAYER"
if(M||S){
Styl+=" ID="+divId
Styl+=" style='position:absolute;top:"+divY+";left:"+divX+";width:"+divW+";height:"+divH+bkCol
Styl+=";visibility:"+Vis[visb]+";z-index:"+zInd
Styl+="'>"
}
if(N){
Styl+=" ID="+divId
Styl+=" top="+divY+" left="+divX+" width="+divW+" height="+divH+bkCol
Styl+=" visibility="+Vis[visb]+" z-index="+zInd
Styl+=">"
}
document.writeln(Styl)
}
function EndDiv(){
(M||S)? document.writeln("</DIV>"): document.writeln("</LAYER>")
}
function PutIt(ID,dX,dY){
if(N){
document.layers[ID].left=dX
document.layers[ID].top=dY
}
if(M){
document.all[ID].style.left=dX
document.all[ID].style.top=dY
}
if(S){
document.getElementById(ID).style.left=dX
document.getElementById(ID).style.top=dY
}
}
function ShowHide(ID,vs){
if(N){
document.layers[ID].visibility=Vis[vs]
}
if(M){
document.all[ID].style.visibility=Vis[vs]
}
if(S){
document.getElementById(ID).style.visibility=Vis[vs]
}
}
function Xof(ID){
if(N){
return document.layers[ID].left
}
if(M){
return document.all[ID].style.left
}
if(S){
return document.getElementById(ID).style.left
}
}
function Yof(ID){
if(N){
return document.layers[ID].top
}
if(M){
return document.all[ID].style.top
}
if(S){
return document.getElementById(ID).style.top
}
}
function Zind(ID,zz){
if(N){
document.layers[ID].zIndex=zz
}
if(M){
document.all[ID].style.zIndex=zz
}
if(S){
document.getElementById(ID).style.zIndex=zz
}
}
function ChangeCol(ID,colrx){
if(M)document.all[ID].style.background=colrx
if(N)document.layers[ID].bgColor=colrx
if(S)document.getElementById(ID).style.background=colrx
}
function DivWrite(IdName,Str) {
if (N){
document.layers[IdName].document.write(Str)
document.layers[IdName].document.close()
}
if(M) document.all[IdName].innerHTML=Str
if(S) document.getElementById(IdName).innerHTML=Str
}
</SCRIPT>
<SCRIPT>
GetDiv('Top',0,0,100,100,'pink',1,0)
document.write("Top Place")
EndDiv()
GetDiv('Bottom',4000,0,100,100,'pink',1,0)
document.write("Bottom Place")
EndDiv()
d=50
y=0
function Scroll(){
y+=d
if(y>=3800)d=-50
if(y<=0)d=50
window.scroll(0,y)
}
setInterval('Scroll()',50)
</SCRIPT>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<BODY background="pic191.jpg">
</BODY>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 3: must download files below
Files
pic191.jpg
JavaScript Enlarge Image - JavaScript Fading Slide Show - JavaScript Rotating Image script
|

02-06-2010, 01:57 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
OnMouseover Slideshow
Script creates JavaScript menu with links based on rollover effect. While moving detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/image/onmouseover-slideshow.jpg[/IMG]
Demo: JavaScript OnMouseover Slideshow
[SIZE="4"] How to setup[/SIZE]
Step 1: Use JavaScript code below to setup the script
JavaScript
Code:
<script>
function changeimage(towhat,url){
if (document.images){
document.images.targetimage.src=towhat.src
gotolink=url
}
}
function warp(){
window.location=gotolink
}
</script>
<script language="JavaScript1.1">
var myimages=new Array()
var gotolink="#"
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("logojs.gif","photo1.jpg","photo2.jpg","photo3.jpg","photo4.jpg")
</script>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 2: Place HTML below in your BODY section
HTML
Code:
<a href="" onMouseover="changeimage(myimages[0],this.href)">JavaScriptBank. com</a><br>
<a href="" onMouseover="changeimage(myimages[1],this.href)">JavaScriptBank. com</a><br>
<a href="" onMouseover="changeimage(myimages[2],this.href)">JavaScriptBank. com</a><br>
<a href="" onMouseover="changeimage(myimages[3],this.href)">JavaScriptBank. com</a><br>
<a href="" onMouseover="changeimage(myimages[4],this.href)">JavaScriptBank. com</a><br>
<a href="javascript:warp()"><img src="logojs.gif" name="targetimage" border=0></a>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Javascript floating message - Javascript multi level drop down menu - JavaScript in_array()
|

02-13-2010, 06:38 PM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
HTML to Entities script
This JavaScript converts special HTML characters to their entities version inside user entered data such as a TEXTAREA before the detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/utility/html-to-entities-script.jpg[/IMG]
Demo: JavaScript HTML to Entities script
[SIZE="4"] How to setup[/SIZE]
Step 1: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<SCRIPT type=text/javascript>
// HTML to Entities (form) script- By JavaScriptKit. com (hxxp ://w w w.javascriptkit. com)
// For this and over 400+ free scripts, visit JavaScript Kit- hxxp ://w w w.javascriptkit. com/
// This notice must stay intact for use
function html2entities(){
var re=/[(<>"'&]/g
for (i=0; i<arguments.length; i++)
arguments[i].value=arguments[i].value.replace(re, function(m){return replacechar(m)})
}
function replacechar(match){
if (match=="<")
return "<"
else if (match==">")
return ">"
else if (match=="\"")
return """
else if (match=="'")
return "'"
else if (match=="&")
return "&"
}
</SCRIPT>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 2: Place HTML below in your BODY section
HTML
Code:
<FORM><TEXTAREA style="WIDTH: 400px; HEIGHT: 100px" name=data1></TEXTAREA><BR>
<INPUT onclick=html2entities(this.form.data1) type=button value="Convert special chars to entities">
</FORM>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
JavaScript Vertical Marquee - JavaScript DHTML analog clock - JavaScript Backwards Text
|

02-20-2010, 04:24 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Integrate SexyBookmarks into your Personal page with JavaScript
SexyBookmarks - a small plugin for sharing the useful & helpful links on the famous social bookmark services (if... detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/article/integrate-sexybookmarks-into-your-personal-page-with-javascript.jpg[/IMG]
Demo: JavaScript Integrate SexyBookmarks into your Personal page with JavaScript
[SIZE="4"] How to setup[/SIZE]
Step 1: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<script type="text/javascript">
/*
click handler for SexyBookmarks
Credit: Phong Thai Cao - hxxp ://w w w.JavaScriptBank. com
Please keep this creadit when you use this code
*/
jQuery('.sexy-bookmarks a.external').click(function() {
// get the current URL & encode it into the standard URI
var url = encodeURIComponent(window.location.href), desc = '';
// parse the description for the above URL by the text() method of jQuery
// the text must be placed in the P tag with ID="sexy-bookmarks-content"
// so you can change the container of description with another tag and/or another ID
if( jQuery('p.sexy-bookmarks-content').length ) {
desc = encodeURIComponent(jQuery('p.sexy-bookmarks-content').text());
}
// detect the social bookmark site user want to share your URL
// by checking the className of site that we'll declare in the HTML code
// and assign the URL & description we got into the current anchor
// then redirect to the clicked bookmark site, you can use window.open() method for opening the new window
switch(this.parentNode.className) {
case 'sexy-twittley':
this.href += '?title=' + document.title + '&url=' + url + '&desc=' + desc + '&pcat=Internet&tags=';
break;
case 'sexy-digg':
this.href += '?phase=2&title=' + document.title + '&url=' + url + '&desc=' + desc;
break;
case 'sexy-twitter':
this.href += '?status=RT+@your_twitter_id:+' + document.title + '+-+' + url;
break;
case 'sexy-scriptstyle':
this.href += '?title=' + document.title + '&url=' + url;
break;
case 'sexy-reddit':
this.href += '?title=' + document.title + '&url=' + url;
break;
case 'sexy-delicious':
this.href += '?title=' + document.title + '&url=' + url;
break;
case 'sexy-stumbleupon':
this.href += '?title=' + document.title + '&url=' + url;
break;
case 'sexy-mixx':
this.href += '?title=' + document.title + '&page_url=' + url + '&desc=' + desc;
break;
case 'sexy-technorati':
this.href += '?add=' + url;
break;
case 'sexy-blinklist':
this.href += '?Action=Blink/addblink.php&Title=' + document.title + '&Url=' + url;
break;
case 'sexy-diigo':
this.href += '?title=' + document.title + '&url=' + url + '&desc=' + desc;
break;
case 'sexy-yahoobuzz':
this.href += '?submitHeadline=' + document.title + '&submitUrl=' + url + '&submitSummary=' + desc + '&submitCategory=science&submitAssetType=text';
break;
case 'sexy-myspace':
this.href += '?t=' + document.title + '&u=' + url;
break;
case 'sexy-facebook':
this.href += '?t=' + document.title + '&u=' + url;
break;
case 'sexy-designfloat':
this.href += '?title=' + document.title + '&url=' + url;
break;
case 'sexy-devmarks':
this.href += '?posttitle=' + document.title + '&posturl=' + url + '&posttext=' + desc;
break;
case 'sexy-newsvine':
this.href += '?h=' + document.title + '&u=' + url;
break;
case 'sexy-google':
this.href += '?op=add&title=' + document.title + '&bkmk=' + url;
break;
}
})
</script>
Step 2: Place HTML below in your BODY section
HTML
Code:
<script type="text/javascript" src="path/to/directory/js/jquery.js"></script>
<script type="text/javascript" src="path/to/directory/js/sexy-bookmarks-public.js"></script>
<link rel="stylesheet" type="text/css" href="path/to/directory/css/style.css" media="screen" />
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
<li class="sexy-twittley"><a href="hxxp ://twittley. com/submit/" rel="nofollow" class="external" title="Submit this to Twittley">Submit this to Twittley</a></li>
<li class="sexy-digg"><a href="hxxp ://digg. com/submit" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li>
<li class="sexy-twitter"><a href="hxxp ://twitter. com/home" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li>
<li class="sexy-scriptstyle"><a href="hxxp ://scriptandstyle. com/submit" rel="nofollow" class="external" title="Submit this to Script & Style">Submit this to Script & Style</a></li>
<li class="sexy-reddit"><a href="hxxp ://reddit. com/submit" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li>
<li class="sexy-delicious"><a href="hxxp ://del.icio.us/post" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li>
<li class="sexy-stumbleupon"><a href="hxxp ://w w w.stumbleupon. com/submit" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li>
<li class="sexy-mixx"><a href="hxxp ://w w w.mixx. com/submit" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a></li>
<li class="sexy-technorati"><a href="hxxp ://technorati. com/faves" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li>
<li class="sexy-blinklist"><a href="hxxp ://w w w.blinklist. com/index.php" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a></li>
<li class="sexy-diigo"><a href="hxxp ://w w w.diigo. com/post">Post this on Diigo</a></li>
<li class="sexy-yahoobuzz"><a href="hxxp ://buzz.yahoo. com/submit/" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a></li>
<li class="sexy-myspace"><a href="hxxp ://w w w.myspace. com/Modules/PostTo/Pages/" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li>
<li class="sexy-facebook"><a href="hxxp ://w w w.facebook. com/share.php" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li>
<li class="sexy-designfloat"><a href="hxxp ://w w w.designfloat. com/submit.php" rel="nofollow" class="external" title="Submit this to DesignFloat">Submit this to DesignFloat</a></li>
<li class="sexy-devmarks"><a href="hxxp ://devmarks. com/index.php" rel="nofollow" class="external" title="Share this on Devmarks">Share this on Devmarks</a></li>
<li class="sexy-newsvine"><a href="hxxp ://w w w.newsvine. com/_tools/seed&save" rel="nofollow" class="external" title="Seed this on Newsvine">Seed this on Newsvine</a></li>
<li class="sexy-google"><a href="hxxp ://w w w.google. com/bookmarks/mark" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a></li>
</ul>
</div>
Step 3: Download files below
Files
sexy-bookmarks-public.js
sexy-bookmarks-style.css
sexy-sprite.png
sexy-trans.png
jquery.js
JavaScript Enlarge Image - JavaScript Fading Slide Show - JavaScript Rotating Image script
|

02-24-2010, 04:12 PM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Rating star script
Need a system to rate an item on your web page? Let's implement the simple script to do that. This script is very easy to setup and modify, you only copy all JavaScript code into your web page (should... detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/utility/rating-star-script-index.jpg[/IMG]
Demo: JavaScript Rating star script
[SIZE="4"] How to setup[/SIZE]
Step 1: Use JavaScript code below to setup the script
JavaScript
Code:
<SCRIPT language=JavaScript>
string="<a href='hxxp ://javascriptbank. com/' style='text-decoration: none;'>JavaScriptBank. com</a>" // string to elastic text
pausetime=100; // time to elastic effect. Decrease to slow
// do not modify below this line
var sizes = new Array("-8px","-4px","-2px","-1px","0px", "1px", "2px", "4px", "8px", "16px", "32px");
sizes.pos = 0;
function rubberBand()
{
var el = document.all.elastic;
if (el.direction==null) {el.direction = 1;}
else if ((sizes.pos > sizes.length-2) || (sizes.pos==0)) {el.direction *= -1;}
el.style.letterSpacing = sizes[sizes.pos += el.direction];
setTimeout('rubberBand()',pausetime);
}
rubberBand();
</SCRIPT>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<P id=elastic style="FONT-SIZE: 25px; POSITION: relative; TOP: 20px" align=center>
<!-- put desired text below. Replase my text. HTML tag allowed-->
<A href="hxxp ://javascriptbank. com/" style="text-decoration: none;">JavaScriptBank. com</A>
<!-- put desired text above. Replase my text. HTML tag allowed -->
</P>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
JavaScript Enlarge Image - JavaScript Fading Slide Show - JavaScript Rotating Image script
|

03-02-2010, 12:52 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Horizontal Slider JavaScript v2.2
Cross-Browser DHTML Horizontal Slide Show: JavaScript concatenates and slides any number of images from right to left. Adjustable: Size, Backgroun... detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: CSS below for styling thescript, place it into HEAD section
CSS
Code:
<STYLE type=text/css>A {
TEXT-DECORATION: none
}
A:link {
COLOR: blue
}
A:visited {
COLOR: blue
}
A:hover {
COLOR: red; BACKGROUND-COLOR: #66ffff
}
.tab {
FONT-SIZE: 12px; FONT-FAMILY: Arial,Helvetica
}
.tabc {
FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: navy; FONT-FAMILY: Arial,Helvetica; TEXT-ALIGN: center
}
.tabt {
FONT-WEIGHT: bold; FONT-SIZE: 18px; COLOR: red; FONT-FAMILY: Arial,Helvetica; TEXT-ALIGN: center
}
</STYLE>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 2: Use JavaScript code below to setup the script
JavaScript
Code:
<SCRIPT language=JavaScript>
if(top.location != self.location)
top.location.replace(self.location);
</SCRIPT>
<SCRIPT language=javascript>
//If using any portion of this DEMO script,
//one must insert along this notice too:
/***********************************
vasile barsan
* hxxp ://javascripts.vbarsan. com/
* This notice may not be removed
***********************************/
var swidth=310;var sheight=50;var sspeed=2;var resspeed=sspeed;var restart=sspeed;var rspeed=sspeed;var imagef='';
preload1 = new Image();
preload1.src = "../image/gif_logojsb2.gif";
preload2 = new Image();
preload2.src = "../image/gif_logojsb.gif";
preload3 = new Image();
preload3.src = "../image/gif_logojsb2.gif";
var leftimage=new Array();
leftimage[0]='<a href="hxxp ://javascriptbank. com"><img src='+preload1.src+' width=310 height=47 alt="JavaScript Bank"></a>';
leftimage[1]='<a href="hxxp ://javascriptbank. com"><img src='+preload2.src+' width=310 height=47 alt="JavaScript Bank"></a>';
leftimage[2]='<a href="hxxp ://javascriptbank. com"><img src='+preload3.src+' width=310 height=47 alt="JavaScript Bank"></a>';
for(mi=0;mi<leftimage.length;mi++)imagef=imagef+leftimage[mi];
function goup(){if(sspeed!=rspeed*8){sspeed=sspeed*2;restart=sspeed;}}
function start(){if(document.getElementById)firstns6(document.getElementById('slider'));else if(document.all)firstie(slider);else if(document.layers)firstns4(document.slider1.document.slider2);}
var operbr=navigator.userAgent.toLowerCase().indexOf('opera');if(operbr==-1&&navigator.product&&navigator.product=="Gecko"){var agt = navigator.userAgent.toLowerCase();var rvStart = agt.indexOf('rv:');var rvEnd = agt.indexOf(')', rvStart);var check15 = agt.substring(rvStart+3, rvEnd);if(parseFloat(check15)>=1.8) operbr=0;}if (navigator.appVersion.indexOf("Mac")!=-1)operbr=0;
function firstns4(whichdiv){tdivns4=eval(whichdiv);tdivns4.document.write('<nobr>'+imagef+'</nobr>');tdivns4.document.close();thel=tdivns4.document.width;tdivns4.left=swidth;slidens4();}
function slidens4(){if(tdivns4.left>=thel*(-1)){tdivns4.left-=sspeed;setTimeout("slidens4()",100);}else{tdivns4.left=swidth;slidens4();}}
function firstie(whichdiv){tdivie=eval(whichdiv);tdivie.innerHTML=('<nobr>'+imagef+'</nobr>');thel=tdivie.offsetWidth;tdivie.style.pixelLeft=swidth;slideie();}
function slideie(){if(tdivie.style.pixelLeft>thel*(-1)){tdivie.style.pixelLeft-=sspeed;setTimeout("slideie()",100);}else{tdivie.style.pixelLeft=swidth;slideie();}}
function firstns6(whichdiv){tdiv6=eval(whichdiv);tdiv6.innerHTML=('<nobr>'+imagef+'</nobr>');thel=tdiv6.offsetWidth;if(operbr!=-1){opslider.innerHTML='<nobr>'+imagef+'</nobr>';thel=opslider.offsetWidth;}tdiv6.style.left=swidth;slidens6();}
function slidens6(){if(parseInt(tdiv6.style.left)>=thel*(-1)){tdiv6.style.left=parseInt(tdiv6.style.left)-sspeed;setTimeout("slidens6()",100);}else{tdiv6.style.left=swidth;slidens6();}}
</SCRIPT>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
Step 3: Place HTML below in your BODY section
HTML
Code:
<BODY onload=start();>
<SCRIPT language=javascript>document.write('<table border=2 align="center" bgcolor="#ccffcc"><tr><td bgcolor="#ffffcc"><div class=tabc><b><a class=tab href="#" onClick="goup();">Speed<br>UP</a></b></div></td><td width='+swidth+'>');if(document.layers)document.write('<span style="borderWidth:0.1px; borderStyle:none; clip:rect(0 '+swidth+' '+sheight+' 0);"><ilayer width='+swidth+' height='+sheight+' name="slider1"><layer class=tabt width='+swidth+' height='+sheight+'>SLIDING SHOW</layer><layer width='+swidth+' height='+sheight+' name="slider2" onMouseover="sspeed=0;" onMouseout="sspeed=resspeed"></layer></ilayer></span>');else {document.write('<div style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight+' 0);">');if(operbr!=-1)document.write('<div id="opslider" style="position:absolute;visibility:hidden;"></div>');else document.write('<div class=tabt style="position:absolute;width:'+swidth+';height:'+sheight+';">SLIDING SHOW</div>');document.write('<div id="slider" style="position:relative;height:'+sheight+';" onMouseover="sspeed=0;" onMouseout="sspeed=resspeed"></div></div>');}</SCRIPT>
</TD></TR></TABLE><BR>
</fieldset>
</center>
<SCRIPT language=JavaScript>
function ctrlA0(corp) {
with(corp){
focus(); select()
}
if(document.all){
txt=corp.createTextRange()
txt.execCommand("Copy")
window.status='Text copied to clipboard'
}
else window.status='Press ctrl-c to copy the text to the clipboard'
setTimeout("window.status=''",5000)
}
</SCRIPT>
</body>
<!--
This script downloaded from w w w.JavaScriptBank. com
Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
-->
JavaScript Spotlight - JavaScript Validate E-Mail - AJAX Page Content Loader
Last edited by JavaScriptBank : 03-02-2010 at 01:55 AM.
|

03-05-2010, 12:57 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
3D self-revolving cube
This is a spinning three dimensional cube. Eight dots revolve by itself to create a motional cube.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Use JavaScript code below to setup the script
JavaScript
Code:
<SCRIPT language=javascript>
/*
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
*/
<!-- // (c) 2001 Till Nagel, till@netzministerium.de & Rene Sander, rene@netzministerium.de
// ---------------------------------------------------------------------------
// creates cube model with name and (a simple) material
var cubeModel = new Model("cube", new Material("°"));
// defines model points.
// The model's points have to be defined before the respective code is written into the document.
cubeModel.setPoints(createCubeModelPoints());
// ---------------------------------------------------------------------------
// the matrix to transform the model with
var staticRotationMatrix = new Matrix();
staticRotationMatrix.rotateX(0.05);
staticRotationMatrix.rotateY(0.1);
// ---------------------------------------------------------------------------
function initOnLoad() {
fixNetscape();
// assign layer (only for Netscape 4.x, for all other browsers
// this is done automatically when writing the point code)
cubeModel.assignLayers();
// creates and inits matrix to initialize the model
var initMatrix = new Matrix();
initMatrix.scale(50, 50, 50);
// >> begin to work with the model etc.
// initializes model
cubeModel.transform(initMatrix);
// >> first draw of the model (recommended)
cubeModel.draw();
// starts animation
animate();
}
/*
* The main animate method. Calls itself repeatedly.
*/
function animate() {
var delay = 10;
// animates cube model ----------------------------------------
// rotates the cube
cubeModel.transform(staticRotationMatrix);
// updates display
cubeModel.draw();
// calls itself with an delay to decouple client computer speed from the animation speed.
// result: the animation is as fast as possible.
setTimeout("animate()", delay);
}
// ---------------------------------------------------------------------------
function createCubeModelPoints() {
// the cube model
return new Array(
// Point3D( x, y, z, m)
new Point3D( 1, 1, 1, 0),
new Point3D( 1, 1, -1, 0),
new Point3D( 1, -1, 1, 0),
new Point3D( 1, -1, -1, 0),
new Point3D(-1, 1, 1, 0),
new Point3D(-1, 1, -1, 0),
new Point3D(-1, -1, 1, 0),
new Point3D(-1, -1, -1, 0)
);
}
// -->
</SCRIPT>
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<DIV id=fixnetscape style="POSITION: absolute; VISIBILITY: hidden"></DIV>
<SCRIPT language=JavaScript type=text/javascript>
<!-- // (c) 2001 Till Nagel, till@netzministerium.de & Rene Sander, rene@netzministerium.de
// MANDATORY: INSERTION OF HTML PART INTO PAGE
// creates the HTML code representing the model's points
// NB: This is written directly into the page from within the method
cubeModel.createPointCode();
// -->
</SCRIPT>
Step 3: Download files below
Files
LyrObj.js
3dhtml.js
ColorUtil.js
materials.js
|

03-08-2010, 02:05 PM
|
 |
Junior Member
|
|
Join Date: Mar 2010
Posts: 3
|
|
Im new here!
Wow, Thanks for the post! This is really great! I am quite a beginner in programming and all of this but I can say that I have learned a lot from your posts. I hope to find a newbie thread here to help newbies to get all the basic s and the important things about programming. thanks a lot!
|

03-13-2010, 01:55 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Top 10 Best JavaScript eBooks that Beginners should Learn
As the title of this post said, you should choose one of these JavaScript ebooks, or some ebooks to start learning if you are JavaScript (or Progamming) beginners. So if you are an expert? Then I hope... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
|

03-16-2010, 11:09 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
RSS AJAX Newsticker
This JavaScript tutorial will show you how to combine RSS, AJAX, and JavaScript to create a real-time RSS ticker.
Thanks to AJAX... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<script type="text/javascript" src="rssticker.js"></script>
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
CNN:
<DIV style="HEIGHT: 100px; border-style: dotted; border-width: 1px; background-color: silver; text-align: left;">
<script type="text/javascript">
//rss_ticker(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
new rss_ticker("CNN", 60, "cnnbox", "cnnclass", 200)
</script>
</DIV>
<br><br><br>
Each ticker on the page can be invoked independently, for example:
<DIV style="HEIGHT: 100px; border-style: dotted; border-width: 1px; background-color: silver; text-align: left;">
<PRE><script type="text/javascript">
//rss_ticker(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
new rss_ticker("CNN", 60, "cnnbox", "cnnclass", 2000)
</script></PRE>
</DIV>
Step 3: must download files below
Files
rssticker.js
|

03-20-2010, 03:26 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Fading Slide Show
Displays images continuously in a slideshow presentation format, with a fade effect on image transitions. (Fade in Internet Explorer 4+ only).... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Use JavaScript code below to setup the script
JavaScript
Code:
<script>
/*
Original: CodeLifter.com (support@codelifter.com)
Web Site: http://www.codelifter.com
*/
// set the following variables
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000
// Duration of crossfade (seconds)
var crossFadeDuration = 3
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = 'logojs.gif'
Pic[1] = 'photo3.jpg'
Pic[2] = 'logojs.gif'
Pic[3] = 'photo5.jpg'
Pic[4] = 'photo2.jpg'
// do not edit anything below this line
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<body onLoad="runSlideShow()">
<img id="VU" src="logojs.gif" name='SlideShow'>
</body>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|

03-23-2010, 02:39 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
VML fireworks script
This is an interesting fireworks effect with the following attributes:
+ Makes use of VML support in IE5+ to render the stars. No graphics involved.
+ Uses conditional... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Copy & Paste CSS code below in your HEAD section
CSS
Code:
<STYLE type=text/css>BODY {
OVERFLOW-X: hidden
}
v\:* {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 2: Place JavaScript below in your HEAD section
JavaScript
Code:
<!--[if IE ]>
<SCRIPT language=JavaScript>
// VML fireworks script By Jacco IJzerman , j.ijzerman1@chello.nl
//Customize fireworks colors:
colors = new Array();
colors[0] = new Array('yellow', 'lime');
colors[1] = new Array('lime', 'green')
colors[2] = new Array('lime', 'blue');
colors[3] = new Array('lightyellow', 'purple');
colors[4] = new Array('lightblue', 'white');
colors[5] = new Array('blue', 'silver');
colors[6] = new Array('red', 'fuchsia');
colors[7] = new Array('yellow', 'red');
maximum = 1000;
vmlobj='';
for(i = 0; i < 12; i++){
vmlobj += '<div id="ster'+i+'" style="position:absolute; left:-50px; top-50px; visibility:hidden; z-index:50;">';
vmlobj += '<v:shape style="width:15px; height:15px;" fillcolor="yellow" coordorigin="0,0" coordsize="200 200">';
vmlobj += '<v:path v="m 8,65 l 72,65, 92,11, 112,65, 174,65, 122,100, 142,155,92,121, 42,155, 60,100 x e"/>';
vmlobj += '<v:stroke on="false" /></v:shape></div>';
}
document.write(vmlobj); vmlobj = null;
aantal = 0;
function begin()
{
try {
if(aantal == maximum){ return;}
kleurschema = Math.floor(Math.random() * colors.length);
posLinks = Math.floor(Math.random() * (document.body.clientWidth - 180));
posLinks = (posLinks < 170)? 170: posLinks;
posBoven = Math.floor(Math.random() * (document.body.clientHeight - 180));
posBoven = (posBoven < 170)? 170: posBoven;
straal = 0; uiteen = true; teller = 1; flikkereffect = false;
for(var i = 0; i < 12; i++){
document.getElementsByTagName('shape')[i].setAttribute('fillcolor', colors[kleurschema][0]);
document.getElementById('ster'+i).style.visibility = 'hidden'; // 5.0 fix
document.getElementById('ster'+i).style.left = posLinks;
document.getElementById('ster'+i).style.top = posBoven;
}
document.getElementById('ster0').style.top = (document.body.clientHeight - 20);
document.getElementById('ster0').style.visibility = 'visible';
omhoog();
} catch(e){}
}
function omhoog()
{
try {
positie = parseInt(document.getElementById('ster0').style.top);
if(positie > posBoven){
document.getElementById('ster0').style.top = (positie - 25);
setTimeout('omhoog()', 50);
} else {
for(i = 1; i < 12; i++){
document.getElementById('ster'+i).style.top = positie;
document.getElementById('ster'+i).style.visibility = 'visible';
}
uiteenspatten();
}
} catch(e){}
}
function uiteenspatten()
{
try {
if(straal > 120 && straal % 10 == 0){
flikkereffect = true;
teller = (teller == colors[kleurschema].length)? 0: (teller+1);
}
for(var i = 0; i < 12; i++){
var hoek = i * 30;
var piHoek = Math.PI - Math.PI / 180 * hoek;
var links = posLinks + Math.round(straal * Math.sin(piHoek));
var boven = positie + Math.round(straal * Math.cos(piHoek));
document.getElementById('ster'+i).style.left = links;
document.getElementById('ster'+i).style.top = boven;
if(flikkereffect){
document.getElementsByTagName('shape')[i].setAttribute('fillcolor', colors[kleurschema][teller]);
}
}
if(straal < 160 && uiteen){
straal += (straal < 120)? 10: 5;
setTimeout('uiteenspatten()', 50);
}
else if(straal > 120){
uiteen = false; straal -= 5;
setTimeout('uiteenspatten()', 50);
}
else if(straal <= 120){
for(var i = 0; i < 12; i++){
document.getElementById('ster'+i).style.visibility = 'hidden';
}
aantal++;
setTimeout('begin()', 500);
}
} catch(e) {}
}
window.onload=begin;
</SCRIPT><![endif]-->
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|

03-27-2010, 03:50 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Vertical Marquee
Text scrolls from bottom to top, pauses, then scrolls up and out of view. A JavaScript link can be added, opening in a new window. Configuration is simple.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Copy & Paste CSS code below in your HEAD section
CSS
Code:
<style type="text/css">
#jump_base {
overflow-y:hidden;
width: 200px;
height: 100px;
border: 2px dotted #000099;
margin: auto;
padding: 0 10px 0 10px;
font-size: .9em;
font-family: Verdana, Arial, sans-serif;
}
#jump_base a {
color: #000099;
background-color: inherit;
}
.news {
background-color: #DDDDDD;
color: inherit;
}
</style>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 2: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<script language="javascript">
// Created by: Mike Hudson :: http://www.afrozeus.com
/*
To change the values in the setupLinks function below.
You will notice there are two arrays for each of Titles and
Links. Currently there are 3 items in each array, but you can easily
expand on that by adding to the array. For example, to add a 4th record,
you would simply include the following 2 lines at the end of setupLinks
function:
arrLinks[3] = "someURL.htm";
arrTitles[3] = "Some title";
*/
function setupLinks() {
arrLinks[0] = "http://forums.webdeveloper.com/forumdisplay.php?s=&forumid=3";
arrTitles[0] = "If you have any questions, be sure to visit our forums.";
arrLinks[1] = "http://javascript.internet.com/new/";
arrTitles[1] = "Don't miss anything — check our new additions.";
arrLinks[2] = "http://www.webreference.com/programming/javascript/diaries/";
arrTitles[2] = "Want to learn JavaScript? Start at the beginning.";
}
var m_iInterval;
var m_Height;
//window.onload = wl;
var iScroll=0;
var arrLinks;
var arrTitles;
var arrCursor = 0;
var arrMax;
window.onload=wl;
function wl() {
m_iInterval = setInterval(ontimer, 10);
var base = document.getElementById("jump_base");
m_Height = base.offsetHeight;
var divi = parseInt(m_Height/5);
m_Height = divi*5;
var td1 = document.getElementById("td1");
var td2 = document.getElementById("td2");
var td3 = document.getElementById("td3");
td1.height = m_Height-5;
td2.height = m_Height-5;
td3.height = m_Height-5;
arrLinks = new Array();
arrTitles = new Array();
setupLinks();
arrMax = arrLinks.length-1;
setLink();
}
function setLink() {
var ilink = document.getElementById("jump_link");
ilink.innerHTML = arrTitles[arrCursor];
ilink.href = arrLinks[arrCursor];
}
function ontimer() {
var base = document.getElementById("jump_base");
iScroll+=5;
if (iScroll>(m_Height*2)) {
iScroll=0;
arrCursor++;
if (arrCursor>arrMax)
arrCursor=0;
setLink();
}
if (iScroll==m_Height) {
pause();
m_iInterval = setTimeout(resume, 4000);
}
base.scrollTop=iScroll;
}
function pause() {
clearInterval(m_iInterval);
}
function resume() {
m_iInterval = setInterval(ontimer, 10);
}
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 3: Place HTML below in your BODY section
HTML
Code:
<div id="jump_base" class="news" onmouseover="pause()" onmouseout="resume()">
<table class="news">
<tr>
<td id="td1"> </td></tr>
<tr><td id = "td2" valign="middle" align="center"><a id="jump_link" href="" target="_new"></a></td></tr>
<tr><td id="td3"> </td></tr>
</table>
</div>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|

03-31-2010, 07:51 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Extreme Form Field Validator
Handle and precess all of your form field validations using just one script. This JavaScript can verify numeric strings; monitor the detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Place CSS below in your HEAD section
CSS
Code:
<style>
#errordiv {
border: 1px solid red;
background-color: #FFAFAF;
display: none;
width: 50%;
margin: 5px;
padding: 5px;
}
.required {
background-color: #CC4444;
}
.required:focus {
background-color: #fff;
border: 1px solid #f00;
}
.checkit {
background-color: #E0E5EF;
}
</style>
Step 2: Use JavaScript code below to setup the script
JavaScript
Code:
<script type="text/javascript" src="chkform.js"></script><script type="text/javascript">
function configureValidation(f,alerttype){
f.firstname.isAlphaNumeric = true;
f.lastname.isAlphaNumeric = true;
f.email.isEmail = true;
f.phone.isPhoneNumber = true;
f.birthday.isDate = true;
f.postalcode.isEmpty = true;
f.password1.isLengthBetween = [4,255];
f.password2.isMatch = f.password1.value;
f.comments.optional = true;
var preCheck = (!f.infohtml.checked && !f.infocss.checked && !f.infojs.checked) ? errormsg[0] : null;
return validateForm(f, preCheck, 'required', alerttype);
}
</script>
Step 3: Place HTML below in your BODY section
HTML
Code:
<div>
<form action="#" method="post" onsubmit="return configureValidation(this,3)" onreset="confirm(errormsg[99])">
<table class="formtable">
<tr>
<td>First Name:</td>
<td><input class="checkit" type="text" id="First name" name="firstname" value="" class="text"></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input class="checkit" type="text" id="Last name" name="lastname" value="" class="text"></td>
</tr>
<tr>
<td>Email:</td>
<td><input class="checkit" type="text" id="Email" name="email" value="" class="text"></td>
</tr>
<tr>
<td>Email Preferred:</td>
<td><select name="emailpreferred">
<option value="text">Text</option>
<option value="html">HTML</option>
<option value="flash">Flash</option>
</select></td>
</tr>
<tr>
<td>Phone: (US only) </td>
<td><input class="checkit" type="text" id="Phone" name="phone" value="000-000-0000" class="text"></td>
</tr>
<tr>
<td>Birthday:</td>
<td><input class="checkit" type="text" id="Birthday" name="birthday" value="mm-dd-yyyy" class="text"></td>
</tr>
<tr>
<td>Gender:</td>
<td>Male:<input type="radio" name="gender" value="male" class="radio" checked="checked"> Female:<input type="radio" name="gender" value="female" class="radio"></td>
</tr>
<tr>
<td>Password:</td>
<td><input class="checkit" onKeyPress="checkCapsLock( event )" id="Password" type="password" name="password1" value="" class="text"></td>
</tr>
<tr>
<td>Re-Enter:</td>
<td><input class="checkit" onKeyPress="checkCapsLock( event )" id="Password again" type="password" name="password2" value="" class="text"></td>
</tr>
<tr>
<td>Postal Code</td>
<td><input class="checkit" name="postalcode" type="text" id="Postal code" onKeyPress="javascript:checkNumber(this);" onKeyUp="javascript:checkNumber(this);"></td>
</tr>
<tr>
<td colspan="2">Select one or more of the following:</td>
</tr>
<tr>
<td colspan="2">HTML:<input type="checkbox" name="infohtml" value="true" class="checkbox"> CSS:<input type="checkbox" name="infocss" value="true" class="checkbox"> javascript:<input type="checkbox" name="infojs" value="true" class="checkbox"></td>
</tr>
<tr>
<td>Comments:</td>
<td><textarea id="Comment" name="comments" class="text" cols="20" rows="4"></textarea></td>
</tr>
</table>
<div id="errordiv"> </div>
<div>
<input type="submit" name="submit" value="Submit" class="button"> <input type="reset" name="reset" value="Reset" class="button"></td>
</form>
</div>
Step 4: downloads
Files
chkform.js
|

04-02-2010, 04:07 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
iPod Player using Flash
Your website have a sound/music system? Are you looking for a cool music player? And you are fan of Apple/iPod? If your answer is 'Yes', let embed this mp3 player script into your web page then let th... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: must download files below
Files
[url="http://www.javascriptbank.com/javascript/multimedia/iPod_Player_using_Flash/iPod_Player_using_Flash.zip"]
|

04-09-2010, 03:10 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Calculator for Sunday
Use this JavaScript to figure out when Sunday will be in a given point of time.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<script language="JavaScript">
<!-- Begin
function WeekStart(Month, Year, StartOfWeekDay) {
_Date = new Date(Year, Month, 1)
_LastDate = new Date()
_LastDate = new Date(_Date)
_LastDate.setMonth(_Date.getMonth() + 1)
_LastDate.setHours(_LastDate.getHours() - 24)
_Returns = new Array()
if (StartOfWeekDay == null) {
StartOfWeekDay = 0
}
var I = 1
while (I <= _LastDate.getDate()) {
_Date.setDate(I)
if (_Date.getDay() == StartOfWeekDay) {
_Returns[_Returns.length] = new Date(_Date)
I += 6
}
I++
}
return(_Returns)
}
// End -->
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 2: Place HTML below in your BODY section
HTML
Code:
<form>Month <select name="Month"><option value="0">Jan
</option><option value="1">Feb
</option><option value="2">Mar
</option><option value="3">Apr
</option><option value="4">May
</option><option value="5">Jun
</option><option value="6">Jul
</option><option value="7">Aug
</option><option value="8">Sep
</option><option value="9">Oct
</option><option value="10">Nov
</option><option value="11">Dec
</option></select><br>
Year <input type="text" name="Year" size="4" maxlength="4"><br>
<input type="button" value="Get Days" onclick="alert(WeekStart(document.forms[0].Month.value, document.forms[0].Year.value, 0))">
</form>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|

04-13-2010, 10:44 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
AutoScroll DIV script
Another script to create a auto scrolling message which move depend on scrollbars.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<script type="text/javascript">
var useWidth = "400px";
var speed = 250 // greater is slower;
var message = "Now is the time for all good men to come to the aid of their country. That's one small step for man, one giant leap for mankind. Ask not what your country can do for you, ask what you can do for your country. | ";
// Remember to include the vertical bar | at the end of the message(s);
var mContainer = "";
var circleMsg = "";
var prevMsg = "";
var useFloat = "";
var xV = 0;
var xL = 0;
var msgLength = 0;
function updateMessage(){
if (circleMsg == ""){circleMsg = mContainer.lastChild.data}
else {circleMsg = prevMsg}
var separatorIdx = circleMsg.lastIndexOf('|');
if (separatorIdx == -1){separatorIdx = msgLength}
circleMsg = circleMsg.substring(1,separatorIdx);
var spliceStr = message.substring(0,msgLength-separatorIdx-1);
var dispMsg = circleMsg+spliceStr;
mContainer.removeChild(mContainer.lastChild);
mContainer.appendChild(document.createTextNode(dispMsg));
prevMsg = circleMsg+'|'+spliceStr;
setTimeout("updateMessage()",speed);
}
function startCrawl(){
mContainer.appendChild(document.createTextNode(message))
setTimeout("updateMessage()",3000); // delay before crawl start;
}
function stayHome(){
var nV = 0;
var nL = 0;
if(!document.body.scrollTop)
{
nV = document.documentElement.scrollTop;
nL = document.documentElement.scrollLeft;
}
else {
nV = document.body.scrollTop;
nL = document.body.scrollLeft;
}
if (nV == 0){window.scrollBy(0,1)}
useFloat.style.top = nV+xV+"px";
useFloat.style.left = nL+xL+"px";
setTimeout("stayHome()",50);
}
window.onload=function(){
mContainer = document.getElementById('crawl');
document.getElementById('isFloat').style.width = useWidth;
msgLength = message.length;
useFloat = document.getElementById('isFloat');
useFloat.style.left = ((screen.width-30)/2)-(parseInt(useWidth)/2)+"px";
xV = useFloat.offsetTop;
xL = useFloat.offsetLeft;
stayHome();
startCrawl();
}
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<Div id='isFloat' style='position:absolute;bottom:20px;overflow:hidden;height:28px;border:solid black 1px;font-size:14pt;background-color:lightyellow;color:darkblue'>
<Div id='crawl' style='padding:3px;white-space:nowrap'></Div>
</Div>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|

04-15-2010, 05:36 PM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
FAQ Drop Down script
Need to create a F.A.Q for your Web site? Use this JavaScript to hide/reveal content on a Web page. Keep your long documents short.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Use JavaScript code below to setup the script
JavaScript
Code:
<script type="text/javascript">
<!-- Begin
// Created by: Fang :: http://tinyurl.com/7v7l8
function toggle(obj) {
// Moz. or IE
var sibling=(obj.nextSibling.nodeType==3)? obj.nextSibling.nextSibling : obj.nextSibling;
// hide or show
if(sibling.style.display=='' || sibling.style.display=='block') {
sibling.style.display='none';
obj.firstChild.firstChild.data='+';
}
else {
sibling.style.display='block';
obj.firstChild.firstChild.data='-';
}
}
//
function initCollapse() {
var oDT=document.getElementById('content').getElementsByTagName('dt');
for (var i=0; i < oDT.length; i++) {
oDT[i].onclick=function() {toggle(this)};
var oSpan=document.createElement('span');
var sign=document.createTextNode('+');
oSpan.appendChild(sign);
oDT[i].insertBefore(oSpan, oDT[i].firstChild);
oSpan.style.fontFamily='monospace';
oSpan.style.paddingRight='0.5em';
oDT[i].style.cursor='pointer';
toggle(oDT[i]);
}
oDT=null;
}
window.onload=function() {if(document.getElementById && document.createElement) {initCollapse();}}
//-->
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Step 2: Place HTML below in your BODY section
HTML
Code:
<dl id="content">
<dt>This is Question #1 <em class="sm">[click here]</em></dt>
<dd>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in.<br><br></dd>
<dt>This is Question #2 <em class="sm">[click here]</em></dt>
<dd>Ma quande lingues coalesce, li grammatica del resultant lingue es plu
simplic e regulari quam ti del coalescent lingues. Li nov lingua franca
va esser plu simplic e regulari quam li existent Europan lingues. It va
esser tam simplic quam Occidental: in fact, it va esser Occidental. A un
Angleso.<br><br></dd>
<dt>This is Question #3 <em class="sm">[click here]</em></dt>
<dd>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in.</dd>
</dl>
</div>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|

04-20-2010, 10:52 AM
|
|
Member
|
|
Join Date: Jul 2009
Posts: 92
|
|
Dynamic HTML Splash Screen
The dynamic animation JavaScript code is fastest and simpliest way to set up a splash screen effect, thanks to this DHTML script! Users will be ab... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
[SIZE="4"] How to setup[/SIZE]
Step 1: Place HTML below in your BODY section
HTML
Code:
<DIV id=splashcontainer style="POSITION: absolute; WIDTH: 350px"></DIV><LAYER
id=splashcontainerns width="450"></LAYER>
<SCRIPT>
/*
Dynamic Splash Screen effect- © Dynamic Drive (www.dynamicdrive.com) Updated: 00/12/18
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
Visit http://dynamicdrive.com
*/
//Specify the paths of the images to be used in the splash screen, if any.
//If none, empty out array (ie: preloadimages=new Array())
var preloadimages=new Array("bongbong.gif","bongbong.gif")
//configure delay in miliseconds between each message (default: 2 seconds)
var intervals=2000
//configure destination URL
var targetdestination="http://javascriptbank.com"
//configure messages to be displayed
//If message contains apostrophe('), backslash them (ie: "I'm fine")
var splashmessage=new Array()
var openingtags='<font face="Arial" size="4">'
splashmessage[0]='<img src="bongbong.gif"> JavaScriptBank.com <img src="bongbong.gif">'
splashmessage[1]='Bank of free JavaScript'
splashmessage[2]='over 2000+ free JavaScript code'
splashmessage[3]='please wait...'
var closingtags='</font>'
//Do not edit below this line (besides HTML code at the very bottom)
var i=0
var ns4=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var theimages=new Array()
//preload images
if (document.images){
for (p=0;p<preloadimages.length;p++){
theimages[p]=new Image()
theimages[p].src=preloadimages[p]
}
}
function displaysplash(){
if (i<splashmessage.length){
sc_cross.style.visibility="hidden"
sc_cross.innerHTML='<b><center>'+openingtags+splashmessage[i]+closingtags+'</center></b>'
sc_cross.style.left=ns6?parseInt(window.pageXOffset)+parseInt(window.innerWidth)/2-parseInt(sc_cross.style.width)/2 : document.body.scrollLeft+document.body.clientWidth/2-parseInt(sc_cross.style.width)/2
sc_cross.style.top=ns6?parseInt(window.pageYOffset)+parseInt(window.innerHeight)/2-sc_cross.offsetHeight/2 : document.body.scrollTop+document.body.clientHeight/2-sc_cross.offsetHeight/2
sc_cross.style.visibility="visible"
i++
}
else{
window.location=targetdestination
return
}
setTimeout("displaysplash()",intervals)
}
function displaysplash_ns(){
if (i<splashmessage.length){
sc_ns.visibility="hide"
sc_ns.document.write('<b>'+openingtags+splashmessage[i]+closingtags+'</b>')
sc_ns.document.close()
sc_ns.left=pageXOffset+window.innerWidth/2-sc_ns.document.width/2
sc_ns.top=pageYOffset+window.innerHeight/2-sc_ns.document.height/2
sc_ns.visibility="show"
i++
}
else{
window.location=targetdestination
return
}
setTimeout("displaysplash_ns()",intervals)
}
function positionsplashcontainer(){
if (ie4||ns6){
sc_cross=ns6?document.getElementById("splashcontainer"):document.all.splashcontainer
displaysplash()
}
else if (ns4){
sc_ns=document.splashcontainerns
sc_ns.visibility="show"
displaysplash_ns()
}
else
window.location=targetdestination
}
window.onload=positionsplashcontainer
</SCRIPT>
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 05:20 PM.
|