-
Web based JavaScript Media Player
Bring the sound of life - music to your visitors by this JavaScript. It is an advanced web based midi player that actually enables you to jump, pause, and manipulate the play list like never before.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<SCRIPT language=JavaScript>
<!-- Begin
counter = 0;
html = true;
songs = new Array();
function addsong() {
file = document.forms[0].file.value;
if(file == "") {
alert("Entra un nombre de archivo o da click en Examinar..");
}
else {
fn = file;
while(fn.indexOf() != -1) {
pos = fn.indexOf();
fn = fn.substring(fn.lenght);
}
if(fn.indexOf(".gif") == 1) {
alert("Sólo sonidos o música");
}
else {
songs[counter] = file;
document.forms[0].selMusica[counter] = new Option(fn, file, false, true);
counter++;
}
document.forms[0].file.value = "";
}
}
function musica() {
document.all.sound.src=document.clock.selMusica.options[document.clock.selMusica.selectedIndex].text;
}
function stop() {
document.all.sound.src="";
}
function count() {
document.clock.songs.value=document.clock.selMusica.options.length;
}
function deletethis() {
if(counter > 0) {
counter--;
document.forms[0].selMusica[counter] = null;
songs[counter] = "";
}
else {
alert("No hay nada en la lista!");
}
}
function bajar() {
document.clock.selMusica.options[document.clock.selMusica.selectedIndex++];
saber2();
saber();
}
function subir() {
document.clock.selMusica.options[document.clock.selMusica.selectedIndex--];
saber2();
saber();
}
function saber() {
document.clock.url.value=document.clock.selMusica.options[document.clock.selMusica.selectedIndex].text;
}
function saber2() {
fn = document.clock.selMusica.options[document.clock.selMusica.selectedIndex].text;
char = unescape("%5C");
while(fn.indexOf(char) != -1) {
pos = fn.indexOf(char);
fn = fn.substring(pos + 1, fn.length);
document.clock.nombre.value=fn;
}
}
// End-->
</SCRIPT>
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<BODY onclick=count() onload=count()>
<BGSOUND id=sound src="">
<FORM name=clock><INPUT type=file name=file size="20"> <INPUT onclick=addsong() type=button value=Add><INPUT onclick=deletethis() type=button value=Delete><BR><INPUT onclick=musica() type=button value=Listen name=empezar>
<INPUT onclick=stop() type=button value=Stop name=detener> You have:<INPUT
readOnly size=2 name=songs>song(s) in the list.<BR>Name of the song:<INPUT
size=25 name=nombre><INPUT onclick="saber2(); saber()" type=button value="Know Name & Url">Url
of the song:<INPUT size=19 name=url> <BR><INPUT onclick=bajar() type=button value=MoveDown><INPUT onclick=subir() type=button value=MoveUp><BR><BR><SELECT
multiple size=20 name=selMusica></SELECT> </FORM>
</BODY>
-
jsDatePick - A Simple Free Javascript Date Picker
jsDatePick is a free JavaScript application that uses DOM techniques to create the date pickers on your web page. Within minutes, you can have a cool popup date pic... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Highlight your PHP and JavaScript codes with PHP highlight_string
Highlighting the source code of your applications on the web pages is an interesting job to any programmer/coder, for showing the simpler look out to all audiences. And this feature has also been supp... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Five Tricks for Improving JavaScript Security
-
Super Cool and Great Button Resources and Tutorials with CSS3
CSS3 - a higher CSS standard for designing HTML layout on web applications - is gradually being used widely. CSS3 is gradually affirming the position and benefit to CSS2... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
10 Small Javascript Tricks You Should Master
In this JavaScript tutorial article, the author provides ten small JavaScript tips and tricks, mainly aimed for beginner and intermediate Javascript developers; also... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Best Ways to Preload Image JavaScript with CSS, AJAX
Surfing time - is the loading time in other hand - is the big problem to all websites, site owners. And now, it's one of important factor to Google for ranking our URLs. For the big sites have a lot o... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Using JavaScript to Change Your Web Page Font Size
In this short JavaScript tutorial, <i>Nurani</i> guides you how to use JavaScript in changing the web page's font size. Maybe the JavaScripts to change font size are not new things on ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<script type="text/javascript">
var min=8;
var max=18;
function zoominLetter() {
var p = document.getElementsByTagName('p');
for(i=0;i<p.length;i++) {
if(p[i].style.fontSize) {
var s = parseInt(p[i].style.fontSize.replace("px",""));
} else {
var s = 12;
}
if(s!=max) {
s += 1;
}
p[i].style.fontSize = s+"px"
}
}
function zoomoutLetter() {
var p = document.getElementsByTagName('p');
for(i=0;i<p.length;i++) {
if(p[i].style.fontSize) {
var s = parseInt(p[i].style.fontSize.replace("px",""));
} else {
var s = 12;
}
if(s!=min) {
s -= 1;
}
p[i].style.fontSize = s+"px"
}
}
</script>
Step 2: Place HTML below in your BODY section
HTML
Code:
<a href="javascript:zoominLetter();">A</a>
<a href="javascript:zoomoutLetter();">a</a>
-
10 Tiptop Analog and Digital Clock Resources and Techniques with Javascript
With beautiful and amazing analog or digital clock on the web pages, you're able to attract more visitors to your website if it relates to some date/time. In Flash, the web developers and web designer... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Helpful JavaScript Time and Date Picker, Plugins for Frameworks
Do you need a beautiful JavaScript time/date picker for your web blog? Just spend a little of time to view these JavaScript time and date pickers in action, maybe you wi... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Incredible and Amazing 3D JavaScript Canvas Enginges
Did you ever imagine the JavaScript programming language could render fantastic, incredible out of 3D effects, animations? Let check out these JavaScript codes presented in this free JavaScript articl... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Super Amazing jQuery Dynamic Navigation Menu Solutions
In the world of jQuery framework, there are many design miracles made by web developers, web designers that attract the web audiences. One of these jQuery d... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
JavaScript Try and Catch Statement in Advance
Through this free JavaScript article tutorial, <i>Louis</i> gives you a detailed viewpoint about <code>Try</code> and <code>Catch</code> statement in the JavaScript wen programming language; by specif... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Great Powered Resources for 7 Helpful jQuery Plug-ins
This free JavaScript article provides a list of over 20 great resources for jQuery add-ons, such as: jQuery AJAX plugin, Paralax, jQuery UI plugin, jQuery plugin form, jQuery Background tricks, jQuery... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Top 10 Free Web Chat box Plug-ins and Add-ons
If you want to make your website more interactive and attract thousands of visitors on a regular basis, then adding an online chat box to the website is perhaps one ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
The Ultimate JavaScript Tutorial in Web Design
In this free ultimate JavaScript tutorial, you'll find the full resources in web development, web design and web programming/coding. From the list of useful resources in this JavaScript tutorial, you ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
jsClock: Featured Digital Clock JavaScript
If you're needing a simple digital clock that is updating automatically and takes directly the time from the server, also you want to show the time in other count... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place CSS below in your HEAD section
CSS
Code:
<style type="text/css">
/*
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
*/
.clock{
cursor:pointer;
padding:5px 5px 5px 5px;
margin:5px 0 5px 0;
width:70px;
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-topleft: 4px;
text-align:center;
font-weight: bold;
font-family: arial;
}
#clock {
background-color:#000000;
color:#00CC66;
}
#reloj {
background-color:#999999;
color:#FFFFFF;
}
#rellotje {
background-color:#237ab2;
color:#FFFFFF;
}
</style>
Step 2: Use JavaScript code below to setup the script
JavaScript
Code:
<script type="text/javascript">
/*
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
*/
function moveClock(idClock,startTime){//move given clock
var timeout=1000;//miliseconds to repeat the function
if ( startTime === undefined ) {//just take the browser time
rightNow = new Date();
hour = rightNow.getHours();
minute = rightNow.getMinutes();
second = rightNow.getSeconds();
}
else{//starttime set
rightNow = startTime.split(':',3);
hour = parseInt(rightNow[0],10);
minute = parseInt(rightNow[1],10);
second = parseInt(rightNow[2],10);
if (second==59){
if (minute==59){
if (hour==23) hour=0;
else hour++;
minute=0;
}else minute++;
second=0;
}else second++;
}
if (minute<10) minute= "0" + minute;
if (second<10) second= "0" + second;
currentTime=hour + ":" + minute + ":" +second;// tim to return
document.getElementById(idClock).innerHTML = currentTime;//tim for the HTML element
//recursivity
if (startTime===undefined) setTimeout("moveClock('"+idClock+"')",timeout);//browser time
else setTimeout("moveClock('"+idClock+"','"+currentTime+"')",timeout);//set time
}
</script>
Step 3: Place HTML below in your BODY section
HTML
Code:
Normal clock using browser time:
<div id="clock" class="clock">clock</div>moveClock("clock");<br /><br />
<hr>
Clock using server time:
<div id="reloj" class="clock">reloj</div> moveClock("reloj","< ?php echo date("G:i:s");? >");<br /><br />
<hr>
Clock with manual time:
<div id="rellotje" class="clock">rellotje</div> moveClock("rellotje","23:58:56");<br /><br />
<hr>
<script type='text/javascript'>
moveClock("clock");
moveClock("reloj","2:23:25");
moveClock("rellotje","23:58:56");
</script>
-
jsPDF: Generating your PDF Web Page Documents using JavaScript
<b>jsPDF</b> is an open-source JavaScript library written by <i>James</i>, this tool allow us generate PDF web page documents in server-side and client-side by using nothing... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<script type="text/javascript" src="base64.js"></script>
<script type="text/javascript" src="sprintf.js"></script>
<script type="text/javascript" src="jspdf.js"></script>
<script type="text/javascript">
function demo1() {
var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');
// Output as Data URI
doc.output('datauri');
}
function demo2() {
var doc = new jsPDF();
doc.setFontSize(22);
doc.text(20, 20, 'This is a title');
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');
// Output as Data URI
doc.output('datauri');
}
function demo3() {
var doc = new jsPDF();
doc.text(20, 20, 'This PDF has a title, subject, author, keywords and a creator.');
// Optional - set properties on the document
doc.setProperties({
title: 'Title',
subject: 'This is the subject',
author: 'James Hall',
keywords: 'generated, javascript, web 2.0, ajax',
creator: 'MEEE'
});
// Output as Data URI
doc.output('datauri');
}
function demo4() {
var name = prompt('What is your name?');
var multiplier = prompt('Enter a number:');
multiplier = parseInt(multiplier);
var doc = new jsPDF();
doc.setFontSize(22);
doc.text(20, 20, 'Questions');
doc.setFontSize(16);
doc.text(20, 30, 'This belongs to: ' + name);
for(var i = 1; i <= 12; i ++) {
doc.text(20, 30 + (i * 10), i + ' x ' + multiplier + ' = ___');
}
doc.addPage();
doc.setFontSize(22);
doc.text(20, 20, 'Answers');
doc.setFontSize(16);
for(var i = 1; i <= 12; i ++) {
doc.text(20, 30 + (i * 10), i + ' x ' + multiplier + ' = ' + (i * multiplier));
}
doc.output('datauri');
}
</script>
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<h2>Simple Two-page Text Document</h2>
<pre>var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');
// Output as Data URI
doc.output('datauri');</pre>
<a href="javascript:demo1()">Run Code</a>
<h2>Different font sizes</h2>
<pre>var doc = new jsPDF();
doc.setFontSize(22);
doc.text(20, 20, 'This is a title');
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');
// Output as Data URI
doc.output('datauri');</pre>
<a href="javascript:demo2()">Run Code</a>
<h2>Adding metadata</h2>
<pre>var doc = new jsPDF();
doc.text(20, 20, 'This PDF has a title, subject, author, keywords and a creator.');
// Optional - set properties on the document
doc.setProperties({
title: 'Title',
subject: 'This is the subject',
author: 'James Hall',
keywords: 'generated, javascript, web 2.0, ajax',
creator: 'MEEE'
});
// Output as Data URI
doc.output('datauri');</pre>
<a href="javascript:demo3()">Run Code</a>
<h2>Example of user input</h2>
<pre>var name = prompt('What is your name?');
var multiplier = prompt('Enter a number:');
multiplier = parseInt(multiplier);
var doc = new jsPDF();
doc.setFontSize(22);
doc.text(20, 20, 'Questions');
doc.setFontSize(16);
doc.text(20, 30, 'This belongs to: ' + name);
for(var i = 1; i <= 12; i ++) {
doc.text(20, 30 + (i * 10), i + ' x ' + multiplier + ' = ___');
}
doc.addPage();
doc.setFontSize(22);
doc.text(20, 20, 'Answers');
doc.setFontSize(16);
for(var i = 1; i <= 12; i ++) {
doc.text(20, 30 + (i * 10), i + ' x ' + multiplier + ' = ' + (i * multiplier));
}
doc.output('datauri');</pre>
<a href="javascript:demo4()">Run Code</a>
Step 3: Download files below
Files
base64.js
jspdf.js
sprintf.js
-
Remove an Element in JavaScript Array
This free JavaScript snippet guides you how to remove an element in JavaScript array, by the value of element or its index. Very useful and helpful for coding and programming in JavaScript. Indexes in... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Simply Button v2: Super Cool-Sexy Button for Your Website
-
Top 50 Most Addictive and Popuplar Facebook mini games
At this time of post, I'm sure that almost people in this world know what's Facebook. And I believe that every one of us ever once enters Facebook to see its content, to know why it becomes popuplar l... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Best of Free Contact Form Services and Generators for Easiest usages
If you have a website whether fashion, educational business or entertainment related, then you must have an email contact form page which is a customary on every web... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Top 10 Excellent & Free Online Poll Makers
With a little of programming skills, we can easy make an online poll creator quickly. However, it takes a lot of time if we like to make our own polls become more a... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Mega Collection of Cheat Sheets with HTML, CSS, PHP, Javascript
Cheat sheets are really helpful in revising your application codes as there are so many functions, constants, classes ... which we cannot remember always but good cheat sheets are of great help in kee... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
More 100 Super Helpful Cheatsheets for Web Designers Web Developers
-
10 Great JavaScript Plugins and Resources for CSS TreeView and Sitemap
HTML JavaScript TreeView and JavaScript Sitemap are good tools to display the structure of your website, are better solutions to organize your huge indexes.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Some Basic JavaScript Guidelines for Accessibility
Do not let everyone receive JavaScript in the way intended, that is the basic nature of the Internet. Therefore, we should have JavaScript applied in a way that enhances your page performance, rather ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Selecting JavaScript HTML Elements Faster with jQuery
There are some simple JavaScript example codes in this free HTML JavaScript tutorial that guide you select the JavaScript HTML elements, detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Selecting JavaScript HTML Elements Faster with jQuery
There are some simple JavaScript example codes in this free HTML JavaScript tutorial that guide you select the JavaScript HTML elements, detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Efficient and Helpful JavaScript/jQuery Tips and Tricks
This free HTML JavaScript tutorial provides 45+ JavaScript/jQuery tips and tricks that help you work in JavaScript tasks better, through live HTML JavaScript example codes. List of some detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
JavaScript Error Codes in Internet Explorer 8
This free JavaScript tutorial lists all JavaScript Error Codes. By understanding the JavaScript Error Codes, you can pinpoint what's wrong with your web page or your JavaScript application. Then you h... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
JavaScript OOP Tutorial for Dummies
In this free HTML JavaScript tutorial, the dummies will have some simple, short concepts about JavaScript OOP programming, OOP in JavaScript such as: how to define a [URL="http://www.javascriptbank.com/tag=JavaScript class"]Ja... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Passing Result from PHP to JavaScript with AJAX & jQuery
This free HTML JavaScript tutorial guides you how to use AJAX and the JavaScript framework jQuery to pass the return data from detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Popular Built-in JavaScript Functions
In this free HTMl JavaScript tutorial, I'll list all of the built-in JavaScript functions available to you. While not everything will be covered, I will cover [URL="http://www.javascriptbank.com/tag=function in JavaScript"]fun... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Collection of Amazing Sorting Table JavaScript using Prototype
With the support of the powerful JavaScript framework - Prototype; JavaScript developers/coders created many sorting table JavaScript example codes, usin... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
Web CSS Content Switcher Without JavaScript
Without JavaScript, we can still switch web content with CSS. It's so incredible but it's so true, just click into this free HTML example code, for testing it by yourself, to find how to make <a href=... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place CSS below in your HEAD section
CSS
Code:
<style type="text/css">
* {
margin: 0;
padding: 0;
}
img {
border: none;
}
h1 {
line-height: 1em;
font-family: "Times New Roman", Times, serif;
color: #666;
font-style: italic;
text-align: center;
padding: 30px 0 0 0;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
margin: 0 0 8px 0;
}
h3 {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
}
p {
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
line-height: 1.5em;
margin: 0 0 14px 0;
padding: 30px 0 0 0;
clear: both;
text-align: center;
color: #666;
}
#content-slider {
width: 650px;
overflow: hidden;
height: 300px;
margin: 30px 0 0 0;
border: solid 1px #666;
}
#content-slider-inside {
list-style: none;
height: 320px;
overflow: scroll;
overflow-y: hidden;
}
#content-slider-inside li {
width: 650px;
background: #ccc;
height: 300px;
color: #666;
font-size: 200px;
font-family: "Times New Roman", Times, serif;
font-style: italic;
text-align: center;
line-height: 300px;
}
#navigation {
list-style: none;
margin: 20px 0 0 0;
float: right;
}
#navigation li {
float: left;
width: 30px;
height: 30px;
text-align: center;
margin: 0;
border: solid 1px #ccc;
line-height: 30px;
font-family: Arial, Helvetica, sans-serif;
margin: 0 0 0 5px;
}
#navigation li a, #navigation li a:link, #navigation li a:visited {
text-decoration: none;
display: block;
height: 30px;
color: #666;
}
#navigation li a.selected, #navigation li a.selected:link, #navigation li a.selected:visited {
background: #666;
color: #fff;
}
#navigation li a:hover, #navigation li a:focus, #navigation li a:active {
background: #666;
color: #fff;
}
</style>
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<div style="margin: 0pt auto; width: 650px;">
<h1>A JavaScript Content Switcher That Works Without JavaScript</h1>
<div id="content-slider">
<ul id="content-slider-inside">
<li id="one">1</li>
<li id="two">2</li>
<li id="three">3</li>
<li id="four">4</li>
<li id="five">5</li>
</ul>
</div>
<ul id="navigation">
<li><a href="#one">1</a></li>
<li><a href="#two">2</a></li>
<li><a href="#three">3</a></li>
<li><a href="#four">4</a></li>
<li><a href="#five">5</a></li>
</ul>
<p>This page has no JavaScript, but the content switcher above is fully functional, and even allows deep linking.</p>
<p>JavaScript can now be added as an enhancement to make the content slide, fade, or animate.</p>
<p><a href="http://www.javascriptbank.com/how-create-web-css-content-switcher-without-javascript.html">View the same page with JavaScript/jQuery enhancing it.</a></p>
<p><a href="http://www.javascriptbank.com/how-create-web-css-content-switcher-without-javascript.html">< Go back to the tutorial</a></p>
</div>
-
Inner Popup with Cookie
With this JavaScript, you can create a section to show marjor info on your website like popup, but this JavaScript use [URL="http://www.javascriptbank.com/javascript/"]Java... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<script language="JavaScript" name="PopIn.js" type="text/javascript">
var div_iPop = '<div id="iCoder" pos="tc" style="display:none;">';
div_iPop += ' <table width="517" height="422" cellspacing="0" cellpadding="2" style="border:1px solid #D349AD;">';
div_iPop += ' <tr style="background-color:#D349AD">';
div_iPop += ' <td height="10" >';
div_iPop += ' <table width="100%" cellpadding="0" cellspacing="0" style="background-color:#D349AD;color:white;font:normal 10pt Verdana;">';
div_iPop += ' <tr><th style="font-size: 16px;">Inner Popup with Cookie</th><th style="padding-left:1ex;padding-right:1ex;">';
div_iPop += ' <a href="javascript:iPop_close()" style="color:white;font:normal 10pt Verdana;text-decoration:none;">×</a></th></tr>';
div_iPop += ' </table>';
div_iPop += ' </td>';
div_iPop += ' </tr>';
div_iPop += ' <tr>';
div_iPop += ' <td height="100%" style="background-color:#FFFFCC;color:black;">';
div_iPop += ' With this script, you can create a section to show marjor info on your website like popup, but this script use JavaScript and cookie to show popup once. Popup will display in center of window and will scroll, but this popup has a close button for closing it.<br /><br />';
div_iPop += ' You can change your content in <b><code>div_iPop</code></b> var';
div_iPop += ' </td>';
div_iPop += ' </tr>';
div_iPop += ' </table>';
div_iPop += '</div>';
document.write(div_iPop);
///////////////////////////////////////////////////////////////
// Pop-In Builder (c)2004. iCoder.com All Rights Reserved. //
///////////////////////////////////////////////////////////////
function iPop_close(pop_name) {
if(!pop_name) pop_name = "iCoder";
DHTMLAPI_hide(pop_name);
}
function iPop_close() { DHTMLAPI_hide("iCoder"); }
function iPop_init0() {
if (!iPop_CookieCheck()) return;
DHTMLAPI_init();
iCoder_Obj = DHTMLAPI_getRawObject("iCoder");
iCoder_move();
window.onscroll=iCoder_move;
window.onresize=iCoder_move;
}
function iPop_init1() {
// if (!iPop_CookieCheck()) return;
DHTMLAPI_init();
iCoder_delta = 16;
iCoder_Obj = DHTMLAPI_getRawObject("iCoder");
var theObj = iCoder_Obj; if (theObj && isCSS) theObj = theObj.style;
if (theObj && theObj.visibility == "hidden") return;
if (theObj && theObj.display == "none") { theObj.display = "block"; theObj.position = "absolute"; }
DHTMLAPI_shiftTo(iCoder_Obj, 0, 5000);
var center = DHTMLAPI_positionWindow(iCoder_Obj, true);
iCoder_x = center[0];
iCoder_y = center[1];
var w_scroll = DHTMLAPI_getScrollWindow();
var start_y = parseInt((w_scroll[1]-iCoder_y-DHTMLAPI_getObjectHeight(iCoder_Obj)-100)/100)*100 + iCoder_y;
DHTMLAPI_shiftTo(iCoder_Obj, iCoder_x, start_y);
iCoder_dropstart=setInterval("iCoder_drop()",50);
}
function iCoder_move() {
if (window.iCoder_timeout) clearTimeout(window.iCoder_timeout);
if (!iCoder_Obj) return;
var theObj = iCoder_Obj; if (theObj && isCSS) theObj = theObj.style;
if (theObj && theObj.visibility == "hidden") return;
if (theObj && theObj.display == "none") { theObj.display = "block"; theObj.position = "absolute"; }
DHTMLAPI_positionWindow(iCoder_Obj);
window.iCoder_timeout = setTimeout("iCoder_move()", 100);
}
function DHTMLAPI_positionWindow(elemID, positionOnly) {
var obj = DHTMLAPI_getRawObject(elemID);
var position = obj.getAttribute("pos");
var scrollX = 0, scrollY = 0;
if (document.body && typeof(document.body.scrollTop) != "undefined") {
scrollX += document.body.scrollLeft;
scrollY += document.body.scrollTop;
if (0 == document.body.scrollTop
&& document.documentElement
&& typeof(document.documentElement.scrollTop) != "undefined") {
scrollX += document.documentElement.scrollLeft;
scrollY += document.documentElement.scrollTop;
}
} else if (typeof(window.pageXOffset) != "undefined") {
scrollX += window.pageXOffset;
scrollY += window.pageYOffset;
}
var x = Math.round((DHTMLAPI_getInsideWindowWidth( )/2) - (DHTMLAPI_getObjectWidth(obj)/2)) + scrollX;
var y = Math.round((DHTMLAPI_getInsideWindowHeight( )/2) - (DHTMLAPI_getObjectHeight(obj)/2)) + scrollY;
var shift_position = parseInt(0);
if (isNaN(shift_position)) shift_position = 0;
switch (position) {
case "tc": y = scrollY+shift_position; break;
case "tl": y = scrollY+shift_position; x = scrollX+shift_position; break;
case "tr": y = scrollY+shift_position; x = Math.round(DHTMLAPI_getInsideWindowWidth( ) - DHTMLAPI_getObjectWidth(obj)) + scrollX-shift_position; break;
case "ml": x = scrollX+shift_position; break;
case "mr": x = Math.round(DHTMLAPI_getInsideWindowWidth( ) - DHTMLAPI_getObjectWidth(obj)) + scrollX-shift_position; break;
case "bc": y = Math.round(DHTMLAPI_getInsideWindowHeight( ) - DHTMLAPI_getObjectHeight(obj)) + scrollY-shift_position; break;
case "bl": y = Math.round(DHTMLAPI_getInsideWindowHeight( ) - DHTMLAPI_getObjectHeight(obj)) + scrollY-shift_position; x = scrollX+shift_position; break;
case "br": y = Math.round(DHTMLAPI_getInsideWindowHeight( ) - DHTMLAPI_getObjectHeight(obj)) + scrollY-shift_position; x = Math.round(DHTMLAPI_getInsideWindowWidth( ) - DHTMLAPI_getObjectWidth(obj)) + scrollX-shift_position; break;
}
if (!positionOnly) DHTMLAPI_shiftTo(obj, x, y);
return [x, y];
}
function iCoder_drop() {
var y = DHTMLAPI_getObjectTop(iCoder_Obj);
if ( iCoder_y > y ) DHTMLAPI_shiftTo(iCoder_Obj, iCoder_x, 50+y);
else {
clearInterval(iCoder_dropstart);
iCoder_vibrostart = setInterval("iCoder_vibro()",40);
}
}
function iCoder_vibro() {
var y = DHTMLAPI_getObjectTop(iCoder_Obj);
DHTMLAPI_shiftTo(iCoder_Obj, iCoder_x, y-iCoder_delta);
if (iCoder_delta<0) iCoder_delta += 4;
iCoder_delta *= -1;
if (iCoder_delta==0) {
clearInterval(iCoder_vibrostart);
iCoder_move();
window.onscroll=iCoder_move;
window.onresize=iCoder_move;
}
}
function DHTMLAPI_hide(obj) {
var theObj = DHTMLAPI_getObject(obj);
if (theObj) theObj.visibility = "hidden";
}
function DHTMLAPI_getRawObject(obj) {
var theObj;
if (typeof obj == "string") {
if (isW3C) theObj = document.getElementById(obj);
else if (isIE4) theObj = document.all(obj);
else if (isNN4) theObj = DHTMLAPI_seekLayer(document, obj);
} else theObj = obj;
return theObj;
}
function DHTMLAPI_shiftTo(obj, x, y) {
var theObj = DHTMLAPI_getObject(obj);
if (theObj) {
if (isCSS) {
var units = (typeof theObj.left == "string") ? "px" : 0;
theObj.left = x + units;
theObj.top = y + 100 + units;
} else if (isNN4) theObj.moveTo(x,y);
}
}
function DHTMLAPI_getScrollWindow() {
var scrollX = 0, scrollY = 0;
if (document.body && typeof(document.body.scrollTop) != "undefined") {
scrollX += document.body.scrollLeft;
scrollY += document.body.scrollTop;
} else if (typeof(window.pageXOffset) != "undefined") {
scrollX += window.pageXOffset;
scrollY += window.pageYOffset;
}
return [scrollX, scrollY];
}
function DHTMLAPI_getObjectHeight(obj) {
var elem = DHTMLAPI_getRawObject(obj);
var result = 0;
if (elem.offsetHeight) result = elem.offsetHeight;
else if (elem.clip && elem.clip.height) result = elem.clip.height;
else if (elem.style && elem.style.pixelHeight) result = elem.style.pixelHeight;
return parseInt(result);
}
function DHTMLAPI_getObjectTop(obj) {
var elem = DHTMLAPI_getRawObject(obj);
var result = 0;
if (document.defaultView) {
var style = document.defaultView;
var cssDecl = style.getComputedStyle(elem, "");
result = cssDecl.getPropertyValue("top");
}
else if (elem.currentStyle) result = elem.currentStyle.top;
else if (elem.style) result = elem.style.top;
else if (isNN4) result = elem.top;
return parseInt(result);
}
function DHTMLAPI_getObject(obj) {
var theObj = DHTMLAPI_getRawObject(obj);
if (theObj && isCSS) theObj = theObj.style;
return theObj;
}
function DHTMLAPI_seekLayer(doc, name) {
var theObj;
for (var i = 0; i < doc.layers.length; i++) {
if (doc.layers[i].name == name) {
theObj = doc.layers[i];
break;
}
if (doc.layers[i].document.layers.length > 0) theObj = DHTMLAPI_seekLayer(document.layers[i].document, name);
}
return theObj;
}
function DHTMLAPI_getInsideWindowWidth( ) {
if (window.innerWidth) return window.innerWidth;
else if (isIE6CSS) return document.body.parentElement.clientWidth;
else if (document.body && document.body.clientWidth) return document.body.clientWidth;
return 0;
}
function DHTMLAPI_getInsideWindowHeight( ) {
if (window.innerHeight) return window.innerHeight;
else if (isIE6CSS) return document.body.parentElement.clientHeight;
else if (document.body && document.body.clientHeight) return document.body.clientHeight;
return 0;
}
function DHTMLAPI_getObjectWidth(obj) {
var elem = DHTMLAPI_getRawObject(obj);
var result = 0;
if (elem.offsetWidth) result = elem.offsetWidth;
else if (elem.clip && elem.clip.width) result = elem.clip.width;
else if (elem.style && elem.style.pixelWidth) result = elem.style.pixelWidth;
return parseInt(result);
}
function DHTMLAPI_init( ) {
if (document.images) {
isCSS = (document.body && document.body.style) ? true : false;
isW3C = (isCSS && document.getElementById) ? true : false;
isIE4 = (isCSS && document.all) ? true : false;
isNN4 = (document.layers) ? true : false;
isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
}
}
setTimeout("iPop_init1()", 100);
function iPop_CookieCheck() {if (document.cookie.indexOf("iCoder=") != -1) return false;var d = new Date();var t = parseInt(1); if (isNaN(t)) t = 1;d.setDate(d.getDate() + t);document.cookie = "iCoder="+d.toGMTString()+"; expires="+d.toGMTString()+";";return true;}
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
-
dygraphs: Open Source JavaScript Graph Visualization Library
dygraphs is an open source JavaScript library that produces produces interactive, zoomable charts of time series. It is designed to display dense data sets ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
More 10 jQuery and JavaScript Tips and Tricks to Improve Your Code
Keep going on Efficient and Helpful JavaScript/jQuery Tips and Tricks, this free [URL="http://www.javascriptbank.com/tag=HTML JavaScript tutorial"]HTML JavaSc... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
-
3 Simple Ways to Define a JavaScript class
This free HTML JavaScript tutorial guides you how to setup, define a JavaScript class through 3 simple ways. Please try them in the detailed post, or read more HTML JavaScript tutorial about OOP JavaS... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup