JavaScript – Advance Ads Rotator v1.1
Version: 1.1
Revision: 23 Build 43
JavaScript – Advance Ads Rotator v1.1
Introduction: this script was written for the public. It was a small project to promote and advertise your products, companies and many more. However, you must keep the “Copyright” rules and regulations intact.
This JavaScript is free for use and it’s licence under “Creative Commons Attribution-Non-Commercial”. This means, you are free to copy and reuse any of my codes (non-commercially), as long as you tell people where they’re from.
1.] Download notepad++ from the original author or from another source.
——————————-
http://sourceforge.net/projects/notepad-plus/
http://filehippo.com/download_notepad/
——————————-
2.] Copy this ‘JavaScript’ source code and save it as “ad-rotator.js”.
File: ad-rotator.js
—Copy Source Code—
// Version: 1.1d Revision: 65
// Copyrighted By Lair360 ~2009
// ---------------------------------------------
// Time Synchronization
global.today=new Date();
global.seed=global.today.getTime();
function global()
{
// Please don't modify the calculations and the seed.
global.seed = (global.seed*9301+49297) % 233280;
return global.seed/(233280.0);
};
// This area is the calculation with random numbers.
// But, please don't change anything here.
function rand(number)
{
return Math.ceil(global()*number);
};
// If you have more than one ADS, you might want to change the script here.
// Maximum ADS Rotation: 10 Adverts.
var number=rand(4)-1
// Change the links and images here. Just change these default settings with your own adverts.
// However, please don't remove the "backwards slash" and the "document.write".
if (number == 0) {
document.write("<div align=center><a href=link1 target=_blank>")
document.write("<img src=1.png alt=\"sample1\" border=0></a></div>")
}
if (number == 1) {
document.write("<div align=center><a href=link2 target=_blank>")
document.write("<img src=2.png alt=\"sample2\" border=0></a></div>")
}
if (number == 2) {
document.write("<div align=center><a href=link3 target=_blank>")
document.write("<img src=3.png alt=\"sample3\" border=0></a></div>")
}
if (number == 3) {
document.write("<div align=center><a href=link4 target=_blank>")
document.write("<img src=4.png alt=\"sample4\" border=0></a></div>")
}
// ADS Rotation Ends Here.
// ---------------------------------------------
—End Source Code—
3.] Finally, you’ll need to add this ‘html – string’ into your webpage.
—Copy Source Code—
<script type="text/javascript" language="Javascript" src="ad-rotator.js"></script>
—End Source Code—
4.] Save your webpage and exit. After that, just alter the above JScript with your own images and links.
5.] Finish!
Copyrighted By Lair360


