|
Scripts and Tools Share your free scripts , tools , icons, fontz, screen savers , etc here. |
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Currency Format script
This JavaScript accepts a number or string and formats it like U.S. currency. Adds the dollar sign, rounds to two places past the decimal, adds place holding zeros, and comm... detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/utility/currency-format-script.jpg[/IMG] Demo: JavaScript Currency Format script How to setup Step 1: Place JavaScript below in your HEAD section JavaScript Code:
<SCRIPT LANGUAGE="JavaScript"> // Cyanide_7 (leo7278@hotmail. com) | hxxp ://w w w7.ewebcity. com/cyanide7 <!-- Begin function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num + '.' + cents); } // End --> </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 --> HTML Code:
<form name=currencyform> Enter a number then click the button: <input type=text name=input size=10 value="1000434.23"> <input type=button value="Convert" onclick="this.form.input.value=formatCurrency(this.form.input.value);"> <br><br> or enter a number and click another field: <input type=text name=input2 size=10 value="1000434.23" onBlur="this.value=formatCurrency(this.value);"> </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 --> Command to print web page in javascript - Javascript Time Picker - JavaScript Go To URL Box
|
#22
|
|||
|
|||
World Clock script
By using your computer's clock, you can calculate the time in other time zones all over the world! Currently, the script works for eight of the major time zones. But, just change one entry (or just ad... detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/time/world-clock-script.jpg[/IMG] Demo: JavaScript World Clock script How to setup Step 1: Place JavaScript below in your HEAD section JavaScript Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- Original: Emanuel Gavrilv (eltal@sprint.ca) --> <!-- Begin function GetTime() { var dt = new Date(); var def = dt.getTimezoneOffset()/60; var gmt = (dt.getHours() + def); document.clock.local.value = (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds())); var ending = ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()); var rome =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1)); document.clock.rome.value = (IfZero(rome) + ending); var isr =check24(((gmt + 2) > 24) ? ((gmt + 2) - 24) : (gmt + 2)); document.clock.Israel.value = (IfZero(isr) + ending); var msw =check24(((gmt + 3) > 24) ? ((gmt + 3) - 24) : (gmt + 3)); document.clock.msw.value = (IfZero(msw) + ending); var baku =check24(((gmt + 4) > 24) ? ((gmt + 4) - 24) : (gmt + 4)); document.clock.baku.value = (IfZero(baku) + ending); var del =check24(((gmt + 5) > 24) ? ((gmt + 5) - 24) : (gmt + 5)); document.clock.del.value = (IfZero(del) + ending); var dh =check24(((gmt + 6) > 24) ? ((gmt + 6) - 24) : (gmt + 6)); document.clock.dh.value = (IfZero(dh) + ending); var kok =check24(((gmt +7 ) > 24) ? ((gmt +7 ) - 24) : (gmt + 7)); document.clock.kok.value = (IfZero(kok) + ending); var ho =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8)); document.clock.ho.value = (IfZero(ho) + ending); var tky =check24(((gmt + 9) > 24) ? ((gmt + 9) - 24) : (gmt + 9)); document.clock.tky.value = (IfZero(tky) + ending); var sdn =check24(((gmt + 10) > 24) ? ((gmt + 10) - 24) : (gmt + 10)); document.clock.sdn.value = (IfZero(sdn) + ending); var mag =check24(((gmt + 11) > 24) ? ((gmt + 11) - 24) : (gmt + 11)); document.clock.mag.value = (IfZero(mag) + ending); var wll =check24(((gmt + 12) > 24) ? ((gmt + 12) - 24) : (gmt + 12)); document.clock.wll.value = (IfZero(wll) + ending); var _GMT =check24(((gmt) > 24) ? ((gmt) - 24) : (gmt)); document.clock._GMT.value = (IfZero(_GMT) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds())); var eniw =check24(((gmt + (24-12)) > 24) ? ((gmt + (24-12)) - 24) : (gmt + (24-12))); document.clock.eniw.value = (IfZero(eniw) + ending); var sam =check24(((gmt + (24-11)) > 24) ? ((gmt + (24-11)) - 24) : (gmt + (24-11))); document.clock.sam.value = (IfZero(sam) + ending); var haw =check24(((gmt + (24-10)) > 24) ? ((gmt + (24-10)) - 24) : (gmt + (24-10))); document.clock.Hawaii.value = (IfZero(haw) + ending); var ala =check24(((gmt + (24-9)) > 24) ? ((gmt + (24-9)) - 24) : (gmt + (24-9))); document.clock.alaska.value = (IfZero(ala) + ending); var pacif =check24(((gmt + (24-8)) >= 24) ? ((gmt + (24-8)) - 24) : (gmt + (24-8))); document.clock.pacif.value = (IfZero(pacif) + ending); var mount =check24(((gmt + (24-7)) > 24) ? ((gmt + (24-7)) - 24) : (gmt + (24-7))); document.clock.mount.value = (IfZero(mount) + ending); var center =check24(((gmt + (24-6)) > 24) ? ((gmt + (24-6)) - 24) : (gmt + (24-6))); document.clock.center.value = (IfZero(center) + ending); var east =check24(((gmt + (24-5)) > 24) ? ((gmt + (24-5)) - 24) : (gmt + (24-5))); document.clock.east.value = (IfZero(east) + ending); var atl =check24(((gmt + (24-4)) > 24) ? ((gmt + (24-4)) - 24) : (gmt + (24-4))); document.clock.atl.value = (IfZero(atl) + ending); var bra =check24(((gmt + (24-3)) > 24) ? ((gmt + (24-3)) - 24) : (gmt + (24-3))); bra = (bra >= 24) ? bra - 24 : bra; document.clock.bra.value = (IfZero(bra) + ending); var mid =check24(((gmt + (24-2)) > 24) ? ((gmt + (24-2)) - 24) : (gmt + (24-2))); mid = (mid >= 24) ? mid - 24 : mid; document.clock.mid.value = (IfZero(mid) + ending); var azo =check24(((gmt + (24-1)) > 24) ? ((gmt + (24-1)) - 24) : (gmt + (24-1))); azo = (azo >= 24) ? azo - 24 : azo; document.clock.azo.value = (IfZero(azo) + ending); setTimeout("GetTime()", 1000); } function IfZero(num) { return ((num <= 9) ? ("0" + num) : num); } function check24(hour) { return (hour >= 24) ? hour - 24 : hour; } // End --> </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 --> HTML Code:
<BODY onLoad="javascript:GetTime();"> <form name="clock"> <strong>Local Time <input type="text" size="8" name="local"></strong> <p> Eniwetok (GMT-12) <input type="text" size="8" name="eniw"><br> Samoa (GMT-11) <input type="text" size="8" name="sam"><br> Hawaii (GMT-10) <input type="text" size="8" name="Hawaii"> <p> Alaska (GMT-9) <input type="text" size="8" name="alaska"><br> Pacific Time (GMT-8) <input type="text" size="8" name="pacif"><br> Mountain Time (GMT-7) <input type="text" size="8" name="mount"> <p> Central Time (GMT-6) <input type="text" size="8" name="center"><br> Eastern Time (GMT-5) <input type="text" size="8" name="east"><br> Atlantic Time (GMT-4) <input type="text" size="8" name="atl"> <p> Brazilia (GMT-3) <input type="text" size="8" name="bra"><br> Mid-Atlantic (GMT-2) <input type="text" size="8" name="mid"><br> Azores (GMT-1) <input type="text" size="8" name="azo"> <p> <strong>Greenwich Mean Time (GMT) <input type="text" size="8" name="_GMT"></strong> <p> Rome (GMT +1) <input type="text" size="8" name="rome"><br> Israel (GMT +2) <input type="text" size="8" name="Israel"><br> Moscow (GMT +3) <input type="text" size="8" name="msw"> <p> Baku (GMT +4) <input type="text" size="8" name="baku"><br> New Delhi (GMT +5) <input type="text" size="8" name="del"><br> Dhakar (GMT +6) <input type="text" size="8" name="dh"> <p> Bangkok (GMT +7) <input type="text" size="8" name="kok"><br> Hong Kong (GMT +8) <input type="text" size="8" name="ho"><br> Tokyo (GMT +9) <input type="text" size="8" name="tky"> <p> Sydney (GMT +10) <input type="text" size="8" name="sdn"><br> Magadan (GMT +11) <input type="text" size="8" name="mag"><br> Wellington (GMT +12) <input type="text" size="8" name="wll"> </form> </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 Enlarge Image - JavaScript Fading Slide Show - JavaScript Rotating Image script
|
#23
|
|||
|
|||
DIV Layer Popup onClick
This JavaScript helps you open floating layer popups. The layers alway stay on top, allowing your visitors to work in the main detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/browser/div-layer-popup-onclick.jpg[/IMG] Demo: JavaScript DIV Layer Popup onClick How to setup Step 1: CSS below for styling thescript, place it into HEAD section CSS Code:
<style type="text/css"> /* This script downloaded from w w w.JavaScriptBank. com Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com */ .jsbank_sample_cont {margin: 20px; padding: 20px;} .jsbank_sample_tit {font-weight: bold; margin-bottom: 10px; padding: 5px; width: auto; background-color: #c0c0c0; border: 5px solid #a0a0a0; color: black; text-align: center;} /* Created by: Jeroen Haan Web Site: hxxp ://w w w.haan. net/ */ #layer1 { position: absolute; visibility: hidden; width: 400px; height: 300px; left: 20px; top: 300px; background-color: #ccc; border: 1px solid #000; padding: 10px; } #close { float: right; } </style> JavaScript Code:
<SCRIPT type=text/javascript> <!-- // Created by: Jeroen Haan :: hxxp ://w w w.haan. net/ /* ----------------------------------------------- Floating layer - v.1 (c) 2006 w w w.haan. net contact: jeroen@haan. net You may use this script but please leave the credits on top intact. Please inform us of any improvements made. When usefull we will add your credits. ------------------------------------------------ */ x = 20; y = 70; function setVisible(obj) { obj = document.getElementById(obj); obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible'; } function placeIt(obj) { obj = document.getElementById(obj); if (document.documentElement) { theLeft = document.documentElement.scrollLeft; theTop = document.documentElement.scrollTop; } else if (document.body) { theLeft = document.body.scrollLeft; theTop = document.body.scrollTop; } theLeft += x; theTop += y; obj.style.left = theLeft + 'px' ; obj.style.top = theTop + 'px' ; setTimeout("placeIt('layer1')",500); } window.onscroll = setTimeout("placeIt('layer1')",500); //--> </SCRIPT> HTML Code:
<DIV id=layer1><SPAN id=close><A style="TEXT-DECORATION: none" href="javascript:setVisible('layer1')"><STRONG>Hide</STRONG></A></SPAN> <P>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.</P><BR><BR><IMG height=65 src="../image/logojs.gif" width=120 border=0> </DIV> <p>This link uses the onclick event handler.<br> <a href="#" onclick="setVisible('layer1');return false" target="_self">Open popup</a></p> <p>This next one uses the javascript link inside the href tag.<br> <a href="javascript:setVisible('layer1',true)">Open popup</a></p> <form> And this one uses the input button inside a form tag.<br> <input type="button" value="Open popup" onclick="setVisible('layer1')"> </form> <p>It can also be used in an image map. Here, the word 'Webhost' contains the link<br> <img src="../image/logojs.gif" width="120" height="65" border="0" usemap="#Map"> <map name="Map" id="Map"> <area shape="rect" coords="1,1,113,23" href="#" onclick="setVisible('layer1');return false" target="_self"> </map> JavaScript Make link open in new tab/window - JavaScript World clock - circumference calculator
|
#24
|
|||
|
|||
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 How to setup 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 --> 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 --> Files pic191.jpg JavaScript Bookmark Page script - JavaScript Color Wheel - JavaScript Image slideshow
|
#25
|
|||
|
|||
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 How to setup 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 --> 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 --> Files pic191.jpg Javascript Music Player - Random Text Generator - Floating Image Script
|
#26
|
|||
|
|||
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 How to setup Step 1: Copy & Paste JavaScript code below in your HEAD section 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 --> 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 --> Command to print web page in javascript - Javascript Time Picker - JavaScript Go To URL Box
|
#27
|
|||
|
|||
9 Funniest JavaScript effects
The Internet is getting more and more important, we can use it for working, learning, for entertaining ... Only in the aspect of entertainment, we use the Internet to play the detail at JavaScriptBank. com - 2.000+ free JavaScript codes
[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/article/9-funniest-javascript-effects.jpg[/IMG] Demo: JavaScript 9 Funniest JavaScript effects How to setup AJAX news ticker - JavaScript Refresh Page - JavaScript Unclosable Window
|
#28
|
|||
|
|||
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 How to setup 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 --> 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 Line Graph script - JavaScript Virtual Keyboard - JavaScript Horizontal Slider
|
#29
|
|||
|
|||
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 How to setup Step 1: Place JavaScript 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> 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> Files sexy-bookmarks-public.js sexy-bookmarks-style.css sexy-sprite.png sexy-trans.png jquery.js JavaScript Make link open in new tab/window - JavaScript World clock - circumference calculator
|
#30
|
|||
|
|||
Thankks.bro
|
Bookmarks |
Thread Tools | |
Display Modes | |
|
|