• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

Simple Banner Rotator (ing)

Üyelik Tarihi
7 Ocak 2015
Konular
4,091
Mesajlar
4,274
MFC Puanı
40
Kod:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
// Simple banner rotator
// (c) spyka Web Group 2008
// version info: 1.1.2
// Download & support: http://www.spyka.net
// Forums: http://www.spyka.net/forums
// Please keep this notice in place

function banner(name, url, image, date)
{
    this.name    = name;
    this.url    = url;
    this.image    = image;
    this.date    = date;
}

var banners = new Array();
///////////////////////////////////////////////////////////////////////////////////
//
//                                 START EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

// Full ********ation & support: http://www.spyka.net/forums 

// if 1, all images will be resized to img_width and img_height, else images will display their correct size
var force_size    = 0;
// desired height and width of images, only takes affect if above is = 1
var img_width    = 728;
var img_height    = 90;

// banner list syntax: banners[x] = new banner(website_name, website_url, website_image_url, show_until_date);  DATE FORMAT: dd/mm/yyyy
banners[0] = new banner('AwesomeStyles', 'http://www.awesomestyles.com', 'http://www.awesomestyles.com/images/aimg/728x90-1.gif', '30/04/2009');
banners[1] = new banner('spyka.net Webmaster', 'http://www.spyka.net', 'http://spyka.net/images/88x31.jpg', '10/04/2009');

///////////////////////////////////////////////////////////////////////////////////
//
//                                 END EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

function show_banners()
{
    var am        = banners.length;
    var rand    = Math.floor(Math.random()*am);    
    var bn         = banners[rand];
    
    var image_size     = (force_size == 1) ? ' width="' + img_width + '" height="' + img_height + '"' : '';
    var html         = '<a href="' + bn.url + '" title="' + bn.name + '" target="_blank"><img border="0" src="' + bn.image + '"' + image_size + ' alt="' + bn.name+ '" /></a>';
    
    // get current date string
    var now        = new Date(); 
    
    var input    = bn.date;
    input        = input.split('/', 3);
    var end_date    = new Date();
    end_date        = end_date.setFullYear(parseFloat(input[2]), parseFloat(input[1]), parseFloat(input[0]));
    
    (now < end_date) ? ********.write(html) : show_banners();
}
</script>
<**** http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example</title>
<script type="text/javascript" src="banners.js"></script>
</head>

<body>
<script type="text/javascript">
show_banners();
</script>
</body>
</html>
 
Üst